-
Notifications
You must be signed in to change notification settings - Fork 4
109 lines (91 loc) · 3.41 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
push:
branches:
- master
- develop
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-php:
name: Build ${{ matrix.php }} / ${{ matrix.symfony }}
runs-on: ubuntu-latest
strategy:
max-parallel: 4
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
symfony: ['^5.4', '^6.4']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, xml, ctype, iconv
coverage: none
- name: Setup Composer cache
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Recover Composer caches
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock', '**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies (Composer)
run: |
sed -ri 's/"symfony\/dependency-injection": "(.+)"/"symfony\/dependency-injection": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/form": "(.+)"/"symfony\/form": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/framework-bundle": "(.+)"/"symfony\/framework-bundle": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/http-kernel": "(.+)"/"symfony\/http-kernel": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/security-bundle": "(.+)"/"symfony\/security-bundle": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/translation": "(.+)"/"symfony\/translation": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/twig-bundle": "(.+)"/"symfony\/twig-bundle": "'${{ matrix.symfony }}'"/' composer.json;
sed -ri 's/"symfony\/phpunit-bridge": "(.+)"/"symfony\/phpunit-bridge": "'${{ matrix.symfony }}'"/' composer.json;
composer update --prefer-dist --no-progress
composer info
git checkout composer.json
- name: Lint
run: composer t3g:test:php:lint
- name: CGL
run: composer t3g:cgl
- name: Unit Tests
run: composer t3g:test:php:unit
- name: Git Status
run: |
git status
git status | grep -q "nothing to commit, working tree clean"
build-frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup npm cache
id: npm-cache-dir
shell: bash
run: |
echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Recover npm caches
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies (npm)
run: npm ci
- name: Build frontend artifacts
run: npm run build
- name: Stylelint
run: npm run stylelint
- name: Git Status
run: |
git status
git status | grep -q "nothing to commit, working tree clean"