Skip to content

Commit 14163a5

Browse files
committed
Improve GitHub workflow configurations
1 parent e764646 commit 14163a5

File tree

5 files changed

+30
-69
lines changed

5 files changed

+30
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
name: Build image
1+
name: Build images
22

3-
on:
4-
pull_request:
5-
push:
3+
on: [pull_request, push]
64

75
jobs:
8-
build-image:
9-
name: Test Docker build
6+
build-standalone:
7+
name: Test standalone build
108
runs-on: ubuntu-latest
119
steps:
12-
-
13-
name: Set up Docker Buildx
10+
- name: Set up Docker Buildx
1411
uses: docker/setup-buildx-action@v3
1512
with:
1613
driver: docker-container
1714

18-
-
19-
name: Build Docker image
15+
- name: Build images
2016
uses: docker/build-push-action@v6
2117
with:
2218
platforms: linux/amd64,linux/arm64
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1-
name: Publish image
1+
name: Publish images
22

33
on:
44
push:
5-
tags:
6-
- v*
5+
tags: [v*]
76
schedule:
8-
-
9-
cron: "30 4 * * *"
7+
- cron: "30 4 * * *"
108

119
jobs:
12-
publish-image:
13-
name: Publish Docker image
10+
publish-standalone:
11+
name: Publish standalone image
1412
runs-on: ubuntu-latest
1513
permissions:
1614
id-token: write
1715
contents: read
1816
packages: write
1917
attestations: write
2018
steps:
21-
-
22-
name: Set up Docker Buildx
19+
- name: Set up Docker Buildx
2320
uses: docker/setup-buildx-action@v3
2421
with:
2522
driver: docker-container
2623

27-
-
28-
name: Extract metadata for Docker
24+
- name: Extract metadata for Docker
2925
id: meta
3026
uses: docker/metadata-action@v5
3127
with:
@@ -35,16 +31,14 @@ jobs:
3531
type=semver,pattern={{version}}
3632
type=semver,pattern={{major}}.{{minor}}
3733
38-
-
39-
name: Login to GitHub Packages
34+
- name: Login to GitHub Packages
4035
uses: docker/login-action@v3
4136
with:
4237
registry: ghcr.io
4338
username: ${{ github.actor }}
4439
password: ${{ secrets.GITHUB_TOKEN }}
4540

46-
-
47-
name: Build and push Docker image
41+
- name: Build and push images
4842
id: push
4943
uses: docker/build-push-action@v6
5044
with:
@@ -53,8 +47,7 @@ jobs:
5347
labels: ${{ steps.meta.outputs.labels }}
5448
platforms: linux/amd64,linux/arm64
5549

56-
-
57-
name: Generate artifact attestation
50+
- name: Generate artifact attestation
5851
uses: actions/attest-build-provenance@v2
5952
with:
6053
subject-name: ghcr.io/${{ github.repository }}
Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ name: Lint code & configuration
33
on:
44
pull_request:
55
push:
6-
7-
env:
8-
fail-fast: true
9-
10-
permissions:
11-
contents: read
6+
schedule:
7+
- cron: "30 4 * * *"
128

139
jobs:
1410
linters:
@@ -22,8 +18,6 @@ jobs:
2218
- name: Install PHP with extensions
2319
uses: shivammathur/setup-php@v2
2420
with:
25-
coverage: none
26-
extensions: intl
2721
php-version: 8.3
2822
tools: composer:v2
2923

@@ -48,7 +42,7 @@ jobs:
4842

4943
- name: Lint Twig templates
5044
if: always() && steps.install.outcome == 'success'
51-
run: bin/console lint:twig templates --env=prod
45+
run: bin/console lint:twig templates
5246

5347
#- name: Lint XLIFF translation files
5448
# if: always() && steps.install.outcome == 'success'
@@ -58,17 +52,17 @@ jobs:
5852
# if: always() && steps.install.outcome == 'success'
5953
# run: bin/console lint:translations
6054

61-
- name: Lint Parameters and Services
55+
- name: Lint service container # todo
6256
if: always() && steps.install.outcome == 'success'
6357
run: bin/console lint:container --no-debug
6458

65-
- name: Lint Composer config
59+
- name: Lint Composer configuration
6660
if: always() && steps.install.outcome == 'success'
6761
run: composer validate
6862
# todo enable strict mode, currently license is invalid
6963
# run: composer validate --strict
7064

71-
- name: Check if any dependencies are compromised
65+
- name: Check if any Composer dependencies are compromised
7266
if: always() && steps.install.outcome == 'success'
7367
run: composer audit
7468

@@ -86,8 +80,6 @@ jobs:
8680
- name: Install PHP with extensions
8781
uses: shivammathur/setup-php@v2
8882
with:
89-
coverage: none
90-
extensions: intl
9183
php-version: 8.3
9284
tools: composer:v2
9385

@@ -107,7 +99,7 @@ jobs:
10799
run: composer install --ansi --no-interaction --no-progress
108100

109101
- name: PHP-CS-Fixer
110-
run: ./vendor/bin/php-cs-fixer fix --diff --dry-run
102+
run: vendor/bin/php-cs-fixer fix --diff --dry-run
111103

112104
phpstan:
113105
name: PHPStan
@@ -120,8 +112,6 @@ jobs:
120112
- name: Install PHP with extensions
121113
uses: shivammathur/setup-php@v2
122114
with:
123-
coverage: none
124-
extensions: intl
125115
php-version: 8.3
126116
tools: composer:v2
127117

@@ -142,4 +132,4 @@ jobs:
142132

143133
- name: Run PHPStan
144134
if: always() && steps.install.outcome == 'success'
145-
run: ./vendor/bin/phpstan analyze
135+
run: vendor/bin/phpstan analyze
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
name: Run image tests
22

3-
on:
4-
pull_request:
5-
push:
3+
on: [pull_request, push]
64

75
env:
8-
fail-fast: true
96
GITHUB_TOKEN: ${{ github.token }}
107
PHPUNIT_FLAGS: ""
118

12-
permissions:
13-
contents: read
14-
159
jobs:
16-
phpunit:
17-
name: Testcontainers
10+
testcontainers:
11+
name: Testcontainers (Standalone)
1812
runs-on: ubuntu-latest
1913
continue-on-error: false
2014

@@ -34,8 +28,6 @@ jobs:
3428
- name: Install PHP with extensions
3529
uses: shivammathur/setup-php@v2
3630
with:
37-
coverage: none
38-
extensions: intl, mbstring, zip
3931
php-version: 8.3
4032
tools: composer:v2
4133

.github/workflows/tests.yaml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
name: Run tests
22

3-
on:
4-
pull_request:
5-
push:
3+
on: [pull_request, push]
64

75
env:
8-
fail-fast: true
96
GITHUB_TOKEN: ${{ github.token }}
107
PHPUNIT_FLAGS: ""
118

12-
permissions:
13-
contents: read
14-
159
jobs:
1610
phpunit:
1711
name: "PHPUnit (PHP ${{ matrix.php-version }})"
@@ -39,8 +33,6 @@ jobs:
3933
- name: Install PHP with extensions
4034
uses: shivammathur/setup-php@v2
4135
with:
42-
coverage: none
43-
extensions: intl, mbstring, zip
4436
php-version: ${{ matrix.php-version }}
4537
tools: composer:v2
4638

@@ -72,10 +64,10 @@ jobs:
7264
run: npm run build
7365

7466
- name: Create database schema
75-
run: bin/console --env=test doctrine:schema:create
67+
run: bin/console doctrine:schema:create --env=test
7668

7769
- name: Load database fixtures
78-
run: bin/console --env=test doctrine:fixtures:load --no-interaction
70+
run: bin/console doctrine:fixtures:load --env=test --no-interaction
7971

8072
- name: PHPUnit version
8173
run: bin/phpunit --version
@@ -104,8 +96,6 @@ jobs:
10496
- name: Install PHP with extensions
10597
uses: shivammathur/setup-php@v2
10698
with:
107-
coverage: none
108-
extensions: intl
10999
php-version: 8.3
110100
tools: composer:v2
111101

0 commit comments

Comments
 (0)