-
-
Notifications
You must be signed in to change notification settings - Fork 331
130 lines (116 loc) · 4.4 KB
/
test.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Symfony UX
on:
push:
paths-ignore:
- 'src/*/doc/**'
- 'ux.symfony.com/**'
pull_request:
paths-ignore:
- 'src/*/doc/**'
- 'ux.symfony.com/**'
jobs:
coding-style-js:
name: JavaScript Coding Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
cache: 'yarn'
- run: yarn --immutable
- run: yarn ci
js-dist-current:
name: Check for UnBuilt JS Dist Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: |
yarn.lock
**/package.json
- run: yarn --immutable && yarn build
- name: Check if JS dist files are current
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "The Git workspace is unclean! Changes detected:"
git status --porcelain
git diff
exit 1
else
echo "The Git workspace is clean. No changes detected."
fi
tests-php-components:
runs-on: ubuntu-latest
outputs:
components: ${{ steps.components.outputs.components }}
steps:
- uses: actions/checkout@v4
- id: components
run: |
components=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | jq -R -s -c 'split("\n")[:-1] | map(. | sub("^src/";"")) | sort')
echo "$components"
echo "components=$components" >> $GITHUB_OUTPUT
tests-php:
runs-on: ubuntu-latest
needs: tests-php-components
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.3', '8.4']
include:
- php-version: '8.1'
dependency-version: 'lowest'
- php-version: '8.3'
dependency-version: 'highest'
- php-version: '8.4'
dependency-version: 'highest'
component: ${{ fromJson(needs.tests-php-components.outputs.components )}}
exclude:
- component: Map # does not support PHP 8.1
php-version: '8.1'
- component: Map/src/Bridge/Google # does not support PHP 8.1
php-version: '8.1'
- component: Map/src/Bridge/Leaflet # does not support PHP 8.1
php-version: '8.1'
- component: Swup # has no tests
- component: Turbo # has its own workflow (test-turbo.yml)
- component: Typed # has no tests
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Install root packages
uses: ramsey/composer-install@v3
with:
working-directory: ${{ github.workspace }}
dependency-versions: ${{ matrix.dependency-version }}
- name: Build root packages
run: php .github/build-packages.php
working-directory: ${{ github.workspace }}
- name: Install ${{ matrix.component }} packages
uses: ramsey/composer-install@v3
with:
working-directory: "src/${{ matrix.component }}"
dependency-versions: ${{ matrix.dependency-version }}
- name: ${{ matrix.component }} Tests
working-directory: "src/${{ matrix.component }}"
run: vendor/bin/simple-phpunit
tests-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: |
yarn.lock
**/package.json
- run: yarn --immutable
- run: yarn playwright install
- run: yarn test