Skip to content

Commit 6eb4059

Browse files
authored
Merge pull request #6 from membrane-php/test-workflow
Test workflow
2 parents aac411e + bdb2f10 commit 6eb4059

30 files changed

Lines changed: 624 additions & 857 deletions

.dagger/src/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct()
2323
{
2424
$this->container = dag()
2525
->container()
26-
->from('php:8.3-fpm-alpine')
26+
->from('php:8.4-fpm-alpine')
2727
->withExposedPort(8080)
2828
->withExposedPort(8081)
2929
->withWorkdir('/app');

.dagger/src/Dev.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ public function __construct(
2121
#[DaggerFunction]
2222
public function lintCheck(): Container
2323
{
24-
return (new Base())
24+
return new Base()
2525
->withVendor(
2626
$this->src->file('composer.json'),
2727
$this->src->file('composer.lock'),
2828
)
29+
->withSrc($this->src)
2930
->asContainer()
3031
->withExec([
3132
'./vendor/bin/php-cs-fixer',
@@ -42,7 +43,7 @@ public function test(
4243
string $suite = 'default',
4344
): Container {
4445
// Take advantage of Dagger's caching by using the same base for service and container
45-
$base = (new Base())
46+
$base = new Base()
4647
->withPdo()
4748
->withPcov()
4849
->withNginx($this->src->file('docker/nginx.conf'))
@@ -56,4 +57,20 @@ public function test(
5657
->withServiceBinding('mockserver', $service)
5758
->withExec(['./vendor/bin/phpunit', "--testsuite=$suite"]);
5859
}
60+
61+
#[DaggerFunction]
62+
public function analyze(): Container
63+
{
64+
return new Base()
65+
->withVendor(
66+
$this->src->file('composer.json'),
67+
$this->src->file('composer.lock'),
68+
)
69+
->withSrc($this->src)
70+
->asContainer()
71+
->withExec([
72+
'./vendor/bin/phpstan',
73+
'analyze',
74+
]);
75+
}
5976
}

.dagger/src/Mockserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public function __construct(
2525
#[DefaultPath('.')]
2626
#[Ignore(
2727
'*.md',
28+
'.cache/',
2829
'.dagger/',
2930
'.dockerignore',
3031
'.gitignore',
3132
'.idea/',
32-
'.cache/',
3333
'dagger.json',
3434
'generated/',
3535
'LICENSE',

.github/workflows/checks.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Checks
2+
3+
on:
4+
push
5+
6+
jobs:
7+
dagger:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
packages: write
12+
steps:
13+
- name: Check out the repo
14+
uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
17+
18+
- name: PHPUnit
19+
uses: dagger/dagger-for-github@v5
20+
with:
21+
version: "0.19.6"
22+
verb: call
23+
args: dev test
24+
25+
- name: PHP CS Fixer
26+
uses: dagger/dagger-for-github@v5
27+
with:
28+
version: "0.19.6"
29+
verb: call
30+
args: dev lint-check
31+
32+
- name: PHPStan
33+
uses: dagger/dagger-for-github@v5
34+
with:
35+
version: "0.19.6"
36+
verb: call
37+
args: dev analyze

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "membrane/mock-server",
33
"type": "library",
44
"license": "MPL-2.0",
5-
"minimum-stability": "dev",
5+
"minimum-stability": "stable",
66
"autoload": {
77
"psr-4": {
88
"Membrane\\MockServer\\": "src/",
@@ -20,23 +20,23 @@
2020
}
2121
},
2222
"require": {
23-
"php": "^8.3.0",
24-
"atto/db-module": "dev-main",
23+
"php": "^8.4.0",
24+
"atto/db-module": "^0.1.0",
2525
"atto/framework": "^0.1.3",
26-
"atto/hydrator": "dev-main",
27-
"atto/membrane-module": "^0.1.9",
28-
"atto/orm": "dev-main",
26+
"atto/hydrator": "^0.1.2",
27+
"atto/membrane-module": "^0.1.10",
28+
"atto/orm": "^0.1.0",
2929
"guzzlehttp/psr7": "^2.4",
3030
"membrane/membrane": "^0.10.0",
3131
"membrane/openapi-reader": "^3.0",
3232
"membrane/openapi-router": "^0.5.2",
3333
"symfony/console": "^6.2 || ^7.0"
3434
},
3535
"require-dev": {
36-
"friendsofphp/php-cs-fixer": "^3.88.2",
36+
"friendsofphp/php-cs-fixer": "^v3.90.0",
3737
"guzzlehttp/guzzle": "^7.10.0",
38-
"phpstan/phpstan": "^1.12.5",
39-
"phpunit/phpunit": "^11.5.39",
38+
"phpstan/phpstan": "^2.1.32",
39+
"phpunit/phpunit": "^12.4.4",
4040
"roave/better-reflection": "^6.65.0"
4141
},
4242
"bin": [

0 commit comments

Comments
 (0)