-
Notifications
You must be signed in to change notification settings - Fork 73
140 lines (131 loc) · 3.37 KB
/
test.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: test
on:
pull_request:
paths-ignore:
- "**/*.asciidoc"
- "**/*.md"
- "**/*.png"
push:
branches:
- main
paths-ignore:
- "**/*.asciidoc"
- "**/*.md"
- "**/*.png"
permissions:
contents: read
## Concurrency only allowed in the main branch.
## So old builds running for old commits within the same Pull Request are cancelled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
uses: ./.github/workflows/build.yml
phpt-tests:
name: phpt-tests
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
arch:
- "linux-x86-64"
- "linuxmusl-x86-64"
env:
PHP_VERSION: ${{ matrix.php-version }}
BUILD_ARCHITECTURE: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
- name: Prepare
run: make -f .ci/Makefile prepare
- uses: actions/download-artifact@v3
with:
name: package-parts-${{ matrix.arch }}
path: agent/native/_build/${{ matrix.arch }}-release/
- name: Display structure of downloaded files
run: ls -R
- name: phpt-unit-tests
run: make -f .ci/Makefile run-phpt-tests
static-checks-unit-tests:
name: static-checks-unit-tests
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
dockerfile:
- "Dockerfile"
- "Dockerfile.alpine"
env:
PHP_VERSION: ${{ matrix.php-version }}
DOCKERFILE: ${{ matrix.dockerfile }}
steps:
- uses: actions/checkout@v4
- name: Prepare
run: make -f .ci/Makefile prepare
- name: Static Check / Unit tests
run: make -f .ci/Makefile static-check-unit-test
- if: success() || failure()
name: Prepare Upload
run: >-
find build
-name "*junit.xml"
-exec bash -c 'mv {} "build/${PHP_VERSION}-${DOCKERFILE}-$(basename {})"'
\;
- if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: build/*junit.xml
if-no-files-found: error
build-packages:
permissions:
contents: read
packages: read
needs:
- build
- static-checks-unit-tests
- phpt-tests
uses: ./.github/workflows/build-packages.yml
secrets: inherit
generate-test-packages-matrix:
uses: ./.github/workflows/generate-matrix.yml
test-packages:
permissions:
contents: read
packages: read
needs:
- build-packages
- generate-test-packages-matrix
uses: ./.github/workflows/test-packages.yml
with:
include: ${{ needs.generate-test-packages-matrix.outputs.include }}
secrets: inherit
# The very last job to report whether the Workflow passed.
# This will act as the Branch Protection gatekeeper
ci:
needs:
- test-packages
runs-on: ubuntu-latest
steps:
- name: report
run: echo "CI workflow passed"