Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dagger/src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct()
{
$this->container = dag()
->container()
->from('php:8.3-fpm-alpine')
->from('php:8.4-fpm-alpine')
->withExposedPort(8080)
->withExposedPort(8081)
->withWorkdir('/app');
Expand Down
21 changes: 19 additions & 2 deletions .dagger/src/Dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ public function __construct(
#[DaggerFunction]
public function lintCheck(): Container
{
return (new Base())
return new Base()
->withVendor(
$this->src->file('composer.json'),
$this->src->file('composer.lock'),
)
->withSrc($this->src)
->asContainer()
->withExec([
'./vendor/bin/php-cs-fixer',
Expand All @@ -42,7 +43,7 @@ public function test(
string $suite = 'default',
): Container {
// Take advantage of Dagger's caching by using the same base for service and container
$base = (new Base())
$base = new Base()
->withPdo()
->withPcov()
->withNginx($this->src->file('docker/nginx.conf'))
Expand All @@ -56,4 +57,20 @@ public function test(
->withServiceBinding('mockserver', $service)
->withExec(['./vendor/bin/phpunit', "--testsuite=$suite"]);
}

#[DaggerFunction]
public function analyze(): Container
{
return new Base()
->withVendor(
$this->src->file('composer.json'),
$this->src->file('composer.lock'),
)
->withSrc($this->src)
->asContainer()
->withExec([
'./vendor/bin/phpstan',
'analyze',
]);
}
}
2 changes: 1 addition & 1 deletion .dagger/src/Mockserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public function __construct(
#[DefaultPath('.')]
#[Ignore(
'*.md',
'.cache/',
'.dagger/',
'.dockerignore',
'.gitignore',
'.idea/',
'.cache/',
'dagger.json',
'generated/',
'LICENSE',
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Checks

on:
push

jobs:
dagger:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: PHPUnit
uses: dagger/dagger-for-github@v5
with:
version: "0.19.6"
verb: call
args: dev test

- name: PHP CS Fixer
uses: dagger/dagger-for-github@v5
with:
version: "0.19.6"
verb: call
args: dev lint-check

- name: PHPStan
uses: dagger/dagger-for-github@v5
with:
version: "0.19.6"
verb: call
args: dev analyze
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "membrane/mock-server",
"type": "library",
"license": "MPL-2.0",
"minimum-stability": "dev",
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"Membrane\\MockServer\\": "src/",
Expand All @@ -20,23 +20,23 @@
}
},
"require": {
"php": "^8.3.0",
"atto/db-module": "dev-main",
"php": "^8.4.0",
"atto/db-module": "^0.1.0",
"atto/framework": "^0.1.3",
"atto/hydrator": "dev-main",
"atto/membrane-module": "^0.1.9",
"atto/orm": "dev-main",
"atto/hydrator": "^0.1.2",
"atto/membrane-module": "^0.1.10",
"atto/orm": "^0.1.0",
"guzzlehttp/psr7": "^2.4",
"membrane/membrane": "^0.10.0",
"membrane/openapi-reader": "^3.0",
"membrane/openapi-router": "^0.5.2",
"symfony/console": "^6.2 || ^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.88.2",
"friendsofphp/php-cs-fixer": "^v3.90.0",
"guzzlehttp/guzzle": "^7.10.0",
"phpstan/phpstan": "^1.12.5",
"phpunit/phpunit": "^11.5.39",
"phpstan/phpstan": "^2.1.32",
"phpunit/phpunit": "^12.4.4",
"roave/better-reflection": "^6.65.0"
},
"bin": [
Expand Down
Loading