Skip to content

Commit 9507772

Browse files
authored
Backport: ci: split some binary package tests (#809) (#821)
Backport #809 In the previous versions, some test cases are contained in Build job. It should be executed in a separate job by nature. Signed-off-by: Kentaro Hayashi <[email protected]>
1 parent 9e929df commit 9507772

File tree

5 files changed

+267
-52
lines changed

5 files changed

+267
-52
lines changed

.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: 93 additions & 26 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
14-
timeout-minutes: 60
24+
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
@@ -64,10 +53,36 @@ jobs:
6453
with:
6554
name: packages-lts-apt-source-${{ matrix.rake-job }}
6655
path: fluent-lts-apt-source/apt/repositories
67-
# TODO move the following steps to "Test" job
56+
57+
check_package_size:
58+
name: Check Package Size
59+
runs-on: ubuntu-latest
60+
needs: [define-matrix, build]
61+
strategy:
62+
fail-fast: false
63+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: actions/download-artifact@v4
67+
with:
68+
name: packages-${{ matrix.rake-job }}
69+
path: fluent-package/apt/repositories
6870
- name: Check Package Size
6971
run: |
7072
fluent-package/apt/pkgsize-test.sh ${{ matrix.rake-job }} amd64
73+
installation_test:
74+
name: Installation Test
75+
runs-on: ubuntu-latest
76+
needs: [define-matrix, build]
77+
strategy:
78+
fail-fast: false
79+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: actions/download-artifact@v4
83+
with:
84+
name: packages-${{ matrix.rake-job }}
85+
path: fluent-package/apt/repositories
7186
- name: Installation Test
7287
run: |
7388
mkdir -p .bundle
@@ -77,6 +92,19 @@ jobs:
7792
--volume ${PWD}:/fluentd:ro \
7893
${{ matrix.test-docker-image }} \
7994
/fluentd/fluent-package/apt/install-test.sh
95+
piuparts_test:
96+
name: Piuparts Test
97+
runs-on: ubuntu-latest
98+
needs: [define-matrix, build]
99+
strategy:
100+
fail-fast: false
101+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: actions/download-artifact@v4
105+
with:
106+
name: packages-${{ matrix.rake-job }}
107+
path: fluent-package/apt/repositories
80108
- name: Piuparts (Install/Remove/Upgrade) Test
81109
run: |
82110
mkdir -p .bundle
@@ -87,6 +115,19 @@ jobs:
87115
--volume ${PWD}:/fluentd:ro \
88116
${{ matrix.test-docker-image }} \
89117
/fluentd/fluent-package/apt/piuparts-test.sh
118+
serverspec_test:
119+
name: Serverspec Test
120+
runs-on: ubuntu-latest
121+
needs: [define-matrix, build]
122+
strategy:
123+
fail-fast: false
124+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
125+
steps:
126+
- uses: actions/checkout@v4
127+
- uses: actions/download-artifact@v4
128+
with:
129+
name: packages-${{ matrix.rake-job }}
130+
path: fluent-package/apt/repositories
90131
- name: Serverspec Test
91132
run: |
92133
mkdir -p .bundle
@@ -96,6 +137,19 @@ jobs:
96137
--volume ${PWD}:/fluentd:ro \
97138
${{ matrix.test-docker-image }} \
98139
/fluentd/fluent-package/apt/serverspec-test.sh
140+
confluent_test:
141+
name: Confluent Test
142+
runs-on: ubuntu-latest
143+
needs: [define-matrix, build]
144+
strategy:
145+
fail-fast: false
146+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
147+
steps:
148+
- uses: actions/checkout@v4
149+
- uses: actions/download-artifact@v4
150+
with:
151+
name: packages-${{ matrix.rake-job }}
152+
path: fluent-package/apt/repositories
99153
- name: Confluent Test
100154
run: |
101155
mkdir -p .bundle
@@ -105,6 +159,19 @@ jobs:
105159
--volume ${PWD}:/fluentd:ro \
106160
${{ matrix.test-docker-image }} \
107161
/fluentd/fluent-package/apt/confluent-test.sh
162+
binstubs_test:
163+
name: Binstubs Test
164+
needs: [define-matrix, build]
165+
runs-on: ubuntu-latest
166+
strategy:
167+
fail-fast: false
168+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
169+
steps:
170+
- uses: actions/checkout@v4
171+
- uses: actions/download-artifact@v4
172+
with:
173+
name: packages-${{ matrix.rake-job }}
174+
path: fluent-package/apt/repositories
108175
- name: Binstubs Test
109176
run: |
110177
mkdir -p .bundle
@@ -116,7 +183,7 @@ jobs:
116183
/fluentd/fluent-package/apt/binstubs-test.sh
117184
test:
118185
name: Test ${{ matrix.label }} ${{ matrix.test-file }}
119-
needs: build
186+
needs: [check_package_size, installation_test, piuparts_test, serverspec_test, confluent_test, binstubs_test]
120187
runs-on: ubuntu-latest
121188
timeout-minutes: 15
122189
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)