Skip to content

Commit ebf7f82

Browse files
authored
ci: split some binary package tests (#809)
In the previous versions, some test cases are contained in Build job. It should be executed in a separated job by nature. Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent 84061f9 commit ebf7f82

5 files changed

Lines changed: 279 additions & 51 deletions

File tree

.github/workflows/apt.matrix.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"include": [
3+
{
4+
"label": "Debian bullseye amd64",
5+
"rake-job": "debian-bullseye",
6+
"test-docker-image": "debian:bullseye"
7+
},
8+
{
9+
"label": "Debian bookworm amd64",
10+
"rake-job": "debian-bookworm",
11+
"test-docker-image": "debian:bookworm"
12+
},
13+
{
14+
"label": "Ubuntu Focal amd64",
15+
"rake-job": "ubuntu-focal",
16+
"test-docker-image": "ubuntu:focal"
17+
},
18+
{
19+
"label": "Ubuntu Jammy amd64",
20+
"rake-job": "ubuntu-jammy",
21+
"test-docker-image": "ubuntu:jammy"
22+
},
23+
{
24+
"label": "Ubuntu Noble amd64",
25+
"rake-job": "ubuntu-noble",
26+
"test-docker-image": "ubuntu:noble"
27+
}
28+
]
29+
}

.github/workflows/apt.yml

Lines changed: 92 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,23 @@ concurrency:
99
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
1010
cancel-in-progress: true
1111
jobs:
12+
define-matrix:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
matrix: ${{ steps.set-matrix.outputs.matrix }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- id: set-matrix
19+
# See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example-returning-a-json-object
20+
run: echo "matrix=$(cat apt.matrix.json | jq --compact-output)" >> $GITHUB_OUTPUT
21+
working-directory: .github/workflows/
1222
build:
1323
name: Build
1424
timeout-minutes: 120
25+
needs: define-matrix
1526
strategy:
1627
fail-fast: false
17-
matrix:
18-
label:
19-
- Debian bullseye amd64
20-
- Debian bookworm amd64
21-
- Ubuntu Focal amd64
22-
- Ubuntu Jammy amd64
23-
- Ubuntu Noble amd64
24-
include:
25-
- label: Debian bullseye amd64
26-
rake-job: debian-bullseye
27-
test-docker-image: debian:bullseye
28-
- label: Debian bookworm amd64
29-
rake-job: debian-bookworm
30-
test-docker-image: debian:bookworm
31-
- label: Ubuntu Focal amd64
32-
rake-job: ubuntu-focal
33-
test-docker-image: ubuntu:focal
34-
- label: Ubuntu Jammy amd64
35-
rake-job: ubuntu-jammy
36-
test-docker-image: ubuntu:jammy
37-
- label: Ubuntu Noble amd64
38-
rake-job: ubuntu-noble
39-
test-docker-image: ubuntu:noble
28+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
4029
runs-on: ubuntu-latest
4130
steps:
4231
- uses: actions/checkout@v4
@@ -92,10 +81,36 @@ jobs:
9281
with:
9382
name: packages-lts-apt-source-${{ matrix.rake-job }}
9483
path: fluent-lts-apt-source/apt/repositories
95-
# TODO move the following steps to "Test" job
84+
85+
check_package_size:
86+
name: Check Package Size
87+
runs-on: ubuntu-latest
88+
needs: [define-matrix, build]
89+
strategy:
90+
fail-fast: false
91+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
92+
steps:
93+
- uses: actions/checkout@v4
94+
- uses: actions/download-artifact@v4
95+
with:
96+
name: packages-${{ matrix.rake-job }}
97+
path: fluent-package/apt/repositories
9698
- name: Check Package Size
9799
run: |
98100
fluent-package/apt/pkgsize-test.sh ${{ matrix.rake-job }} amd64
101+
installation_test:
102+
name: Installation Test
103+
runs-on: ubuntu-latest
104+
needs: [define-matrix, build]
105+
strategy:
106+
fail-fast: false
107+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
108+
steps:
109+
- uses: actions/checkout@v4
110+
- uses: actions/download-artifact@v4
111+
with:
112+
name: packages-${{ matrix.rake-job }}
113+
path: fluent-package/apt/repositories
99114
- name: Installation Test
100115
run: |
101116
mkdir -p .bundle
@@ -106,6 +121,19 @@ jobs:
106121
--volume ${PWD}:/fluentd:ro \
107122
${{ matrix.test-docker-image }} \
108123
/fluentd/fluent-package/apt/install-test.sh
124+
piuparts_test:
125+
name: Piuparts Test
126+
runs-on: ubuntu-latest
127+
needs: [define-matrix, build]
128+
strategy:
129+
fail-fast: false
130+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
131+
steps:
132+
- uses: actions/checkout@v4
133+
- uses: actions/download-artifact@v4
134+
with:
135+
name: packages-${{ matrix.rake-job }}
136+
path: fluent-package/apt/repositories
109137
- name: Piuparts (Install/Remove/Upgrade) Test
110138
run: |
111139
mkdir -p .bundle
@@ -117,6 +145,19 @@ jobs:
117145
--volume ${PWD}:/fluentd:ro \
118146
${{ matrix.test-docker-image }} \
119147
/fluentd/fluent-package/apt/piuparts-test.sh
148+
serverspec_test:
149+
name: Serverspec Test
150+
runs-on: ubuntu-latest
151+
needs: [define-matrix, build]
152+
strategy:
153+
fail-fast: false
154+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
155+
steps:
156+
- uses: actions/checkout@v4
157+
- uses: actions/download-artifact@v4
158+
with:
159+
name: packages-${{ matrix.rake-job }}
160+
path: fluent-package/apt/repositories
120161
- name: Serverspec Test
121162
run: |
122163
mkdir -p .bundle
@@ -127,6 +168,19 @@ jobs:
127168
--volume ${PWD}:/fluentd:ro \
128169
${{ matrix.test-docker-image }} \
129170
/fluentd/fluent-package/apt/serverspec-test.sh
171+
confluent_test:
172+
name: Confluent Test
173+
runs-on: ubuntu-latest
174+
needs: [define-matrix, build]
175+
strategy:
176+
fail-fast: false
177+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
178+
steps:
179+
- uses: actions/checkout@v4
180+
- uses: actions/download-artifact@v4
181+
with:
182+
name: packages-${{ matrix.rake-job }}
183+
path: fluent-package/apt/repositories
130184
- name: Confluent Test
131185
run: |
132186
mkdir -p .bundle
@@ -137,6 +191,19 @@ jobs:
137191
--volume ${PWD}:/fluentd:ro \
138192
${{ matrix.test-docker-image }} \
139193
/fluentd/fluent-package/apt/confluent-test.sh
194+
binstubs_test:
195+
name: Binstubs Test
196+
needs: [define-matrix, build]
197+
runs-on: ubuntu-latest
198+
strategy:
199+
fail-fast: false
200+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
201+
steps:
202+
- uses: actions/checkout@v4
203+
- uses: actions/download-artifact@v4
204+
with:
205+
name: packages-${{ matrix.rake-job }}
206+
path: fluent-package/apt/repositories
140207
- name: Binstubs Test
141208
run: |
142209
mkdir -p .bundle
@@ -149,7 +216,7 @@ jobs:
149216
/fluentd/fluent-package/apt/binstubs-test.sh
150217
test:
151218
name: Test ${{ matrix.label }} ${{ matrix.test }}
152-
needs: build
219+
needs: [check_package_size, installation_test, piuparts_test, serverspec_test, confluent_test, binstubs_test]
153220
runs-on: ubuntu-latest
154221
timeout-minutes: 15
155222
strategy:

.github/workflows/windows.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,30 @@ jobs:
3838
with:
3939
name: packages-windows-x86_64
4040
path: fluent-package/msi/repositories
41+
check_package_size:
42+
name: Check Package Size
43+
needs: build
44+
runs-on: windows-2019
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/download-artifact@v4
48+
with:
49+
name: packages-windows-x86_64
50+
path: fluent-package/msi/repositories
4151
- name: Check Package Size
4252
shell: pwsh
4353
run: |
4454
powershell -ExecutionPolicy Bypass -Command ".\fluent-package\msi\pkgsize-test.ps1"
55+
installation_test:
56+
name: Installation Test
57+
needs: build
58+
runs-on: windows-2019
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/download-artifact@v4
62+
with:
63+
name: packages-windows-x86_64
64+
path: fluent-package/msi/repositories
4565
- name: Installation Test
4666
shell: pwsh
4767
run: |
@@ -52,6 +72,16 @@ jobs:
5272
--volume ${PWD}:C:\fluentd:ro `
5373
mcr.microsoft.com/dotnet/framework/runtime:3.5 `
5474
powershell -ExecutionPolicy Bypass -Command "C:\fluentd\fluent-package\msi\install-test.ps1"
75+
update_from_v4_test:
76+
name: Migration From v4 Test
77+
needs: build
78+
runs-on: windows-2019
79+
steps:
80+
- uses: actions/checkout@v4
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: packages-windows-x86_64
84+
path: fluent-package/msi/repositories
5585
- name: Migration From v4 Test
5686
shell: pwsh
5787
run: |
@@ -61,6 +91,16 @@ jobs:
6191
--volume ${PWD}:C:\fluentd:ro `
6292
mcr.microsoft.com/dotnet/framework/runtime:3.5 `
6393
powershell -ExecutionPolicy Bypass -Command "C:\fluentd\fluent-package\msi\update-from-v4-test.ps1"
94+
update_from_v5_test:
95+
name: Update From v5 Test
96+
needs: build
97+
runs-on: windows-2019
98+
steps:
99+
- uses: actions/checkout@v4
100+
- uses: actions/download-artifact@v4
101+
with:
102+
name: packages-windows-x86_64
103+
path: fluent-package/msi/repositories
64104
- name: Update From v5 Test
65105
shell: pwsh
66106
run: |
@@ -70,6 +110,16 @@ jobs:
70110
--volume ${PWD}:C:\fluentd:ro `
71111
mcr.microsoft.com/dotnet/framework/runtime:3.5 `
72112
powershell -ExecutionPolicy Bypass -Command "C:\fluentd\fluent-package\msi\update-from-v5-test.ps1"
113+
serverspec_test:
114+
name: Serverspec Test
115+
needs: build
116+
runs-on: windows-2019
117+
steps:
118+
- uses: actions/checkout@v4
119+
- uses: actions/download-artifact@v4
120+
with:
121+
name: packages-windows-x86_64
122+
path: fluent-package/msi/repositories
73123
- name: Serverspec Test
74124
shell: pwsh
75125
run: |

.github/workflows/yum.matrix.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"include": [
3+
{
4+
"label": "RockyLinux 8 x86_64",
5+
"rake-job": "rockylinux-8",
6+
"test-docker-image": "rockylinux:8",
7+
"centos-stream": false
8+
},
9+
{
10+
"label": "AlmaLinux 9 x86_64",
11+
"rake-job": "almalinux-9",
12+
"test-docker-image": "almalinux:9",
13+
"centos-stream": false
14+
},
15+
{
16+
"label": "Amazon Linux 2 x86_64",
17+
"rake-job": "amazonlinux-2",
18+
"test-docker-image": "amazonlinux:2",
19+
"centos-stream": false
20+
},
21+
{
22+
"label": "Amazon Linux 2023 x86_64",
23+
"rake-job": "amazonlinux-2023",
24+
"test-docker-image": "amazonlinux:2023",
25+
"centos-stream": false
26+
}
27+
]
28+
}

0 commit comments

Comments
 (0)