Skip to content

Commit 3bc1631

Browse files
committed
Improve GitHub workflow configurations
1 parent d64aeb4 commit 3bc1631

File tree

5 files changed

+29
-72
lines changed

5 files changed

+29
-72
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: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
name: Lint code & configuration
22

3-
on:
4-
pull_request:
5-
push:
6-
7-
env:
8-
fail-fast: true
9-
10-
permissions:
11-
contents: read
3+
on: [pull_request, push]
124

135
jobs:
146
linters:
@@ -22,8 +14,6 @@ jobs:
2214
- name: Install PHP with extensions
2315
uses: shivammathur/setup-php@v2
2416
with:
25-
coverage: none
26-
extensions: intl
2717
php-version: 8.3
2818
tools: composer:v2
2919

@@ -48,7 +38,7 @@ jobs:
4838

4939
- name: Lint Twig templates
5040
if: always() && steps.install.outcome == 'success'
51-
run: bin/console lint:twig templates --env=prod
41+
run: bin/console lint:twig templates
5242

5343
#- name: Lint XLIFF translation files
5444
# if: always() && steps.install.outcome == 'success'
@@ -58,17 +48,17 @@ jobs:
5848
# if: always() && steps.install.outcome == 'success'
5949
# run: bin/console lint:translations
6050

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

65-
- name: Lint Composer config
55+
- name: Lint Composer configuration
6656
if: always() && steps.install.outcome == 'success'
6757
run: composer validate
6858
# todo enable strict mode, currently license is invalid
6959
# run: composer validate --strict
7060

71-
- name: Check if any dependencies are compromised
61+
- name: Check if any Composer dependencies are compromised
7262
if: always() && steps.install.outcome == 'success'
7363
run: composer audit
7464

@@ -86,8 +76,6 @@ jobs:
8676
- name: Install PHP with extensions
8777
uses: shivammathur/setup-php@v2
8878
with:
89-
coverage: none
90-
extensions: intl
9179
php-version: 8.3
9280
tools: composer:v2
9381

@@ -107,7 +95,7 @@ jobs:
10795
run: composer install --ansi --no-interaction --no-progress
10896

10997
- name: PHP-CS-Fixer
110-
run: ./vendor/bin/php-cs-fixer fix --diff --dry-run
98+
run: vendor/bin/php-cs-fixer fix --diff --dry-run
11199

112100
phpstan:
113101
name: PHPStan
@@ -120,8 +108,6 @@ jobs:
120108
- name: Install PHP with extensions
121109
uses: shivammathur/setup-php@v2
122110
with:
123-
coverage: none
124-
extensions: intl
125111
php-version: 8.3
126112
tools: composer:v2
127113

@@ -142,4 +128,4 @@ jobs:
142128

143129
- name: Run PHPStan
144130
if: always() && steps.install.outcome == 'success'
145-
run: ./vendor/bin/phpstan analyze
131+
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)