Skip to content

Commit 2a9ddfb

Browse files
committed
Improve GitHub workflow configurations
1 parent d64aeb4 commit 2a9ddfb

File tree

5 files changed

+29
-58
lines changed

5 files changed

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

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

75
env:
86
fail-fast: true
@@ -22,8 +20,6 @@ jobs:
2220
- name: Install PHP with extensions
2321
uses: shivammathur/setup-php@v2
2422
with:
25-
coverage: none
26-
extensions: intl
2723
php-version: 8.3
2824
tools: composer:v2
2925

@@ -48,7 +44,7 @@ jobs:
4844

4945
- name: Lint Twig templates
5046
if: always() && steps.install.outcome == 'success'
51-
run: bin/console lint:twig templates --env=prod
47+
run: bin/console lint:twig templates
5248

5349
#- name: Lint XLIFF translation files
5450
# if: always() && steps.install.outcome == 'success'
@@ -58,17 +54,17 @@ jobs:
5854
# if: always() && steps.install.outcome == 'success'
5955
# run: bin/console lint:translations
6056

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

65-
- name: Lint Composer config
61+
- name: Lint Composer configuration
6662
if: always() && steps.install.outcome == 'success'
6763
run: composer validate
6864
# todo enable strict mode, currently license is invalid
6965
# run: composer validate --strict
7066

71-
- name: Check if any dependencies are compromised
67+
- name: Check if any Composer dependencies are compromised
7268
if: always() && steps.install.outcome == 'success'
7369
run: composer audit
7470

@@ -86,8 +82,6 @@ jobs:
8682
- name: Install PHP with extensions
8783
uses: shivammathur/setup-php@v2
8884
with:
89-
coverage: none
90-
extensions: intl
9185
php-version: 8.3
9286
tools: composer:v2
9387

@@ -107,7 +101,7 @@ jobs:
107101
run: composer install --ansi --no-interaction --no-progress
108102

109103
- name: PHP-CS-Fixer
110-
run: ./vendor/bin/php-cs-fixer fix --diff --dry-run
104+
run: vendor/bin/php-cs-fixer fix --diff --dry-run
111105

112106
phpstan:
113107
name: PHPStan
@@ -120,8 +114,6 @@ jobs:
120114
- name: Install PHP with extensions
121115
uses: shivammathur/setup-php@v2
122116
with:
123-
coverage: none
124-
extensions: intl
125117
php-version: 8.3
126118
tools: composer:v2
127119

@@ -142,4 +134,4 @@ jobs:
142134

143135
- name: Run PHPStan
144136
if: always() && steps.install.outcome == 'success'
145-
run: ./vendor/bin/phpstan analyze
137+
run: vendor/bin/phpstan analyze

.github/workflows/tests-docker.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Run image tests
22

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

75
env:
86
fail-fast: true
@@ -13,8 +11,8 @@ permissions:
1311
contents: read
1412

1513
jobs:
16-
phpunit:
17-
name: Testcontainers
14+
testcontainers:
15+
name: Testcontainers (Standalone)
1816
runs-on: ubuntu-latest
1917
continue-on-error: false
2018

@@ -34,8 +32,6 @@ jobs:
3432
- name: Install PHP with extensions
3533
uses: shivammathur/setup-php@v2
3634
with:
37-
coverage: none
38-
extensions: intl, mbstring, zip
3935
php-version: 8.3
4036
tools: composer:v2
4137

.github/workflows/tests.yaml

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

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

75
env:
86
fail-fast: true
@@ -39,8 +37,6 @@ jobs:
3937
- name: Install PHP with extensions
4038
uses: shivammathur/setup-php@v2
4139
with:
42-
coverage: none
43-
extensions: intl, mbstring, zip
4440
php-version: ${{ matrix.php-version }}
4541
tools: composer:v2
4642

@@ -72,10 +68,10 @@ jobs:
7268
run: npm run build
7369

7470
- name: Create database schema
75-
run: bin/console --env=test doctrine:schema:create
71+
run: bin/console doctrine:schema:create --env=test
7672

7773
- name: Load database fixtures
78-
run: bin/console --env=test doctrine:fixtures:load --no-interaction
74+
run: bin/console doctrine:fixtures:load --env=test --no-interaction
7975

8076
- name: PHPUnit version
8177
run: bin/phpunit --version
@@ -104,8 +100,6 @@ jobs:
104100
- name: Install PHP with extensions
105101
uses: shivammathur/setup-php@v2
106102
with:
107-
coverage: none
108-
extensions: intl
109103
php-version: 8.3
110104
tools: composer:v2
111105

0 commit comments

Comments
 (0)