-
Notifications
You must be signed in to change notification settings - Fork 29
270 lines (269 loc) · 9.35 KB
/
apt.yml
File metadata and controls
270 lines (269 loc) · 9.35 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: Apt based Linux
on:
push:
branches:
- master
- fluent-package-v5
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
# 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
run: echo "matrix=$(cat apt.matrix.json | jq --compact-output)" >> $GITHUB_OUTPUT
working-directory: .github/workflows/
build:
name: Build
timeout-minutes: 120
needs: define-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: cache deb
uses: actions/cache@v4
id: cache-deb
with:
path: |
fluent-package/apt/repositories
fluent-apt-source/apt/repositories
fluent-lts-apt-source/apt/repositories
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', 'fluent-package/templates/**', 'fluent-package/debian/**', 'fluent-package/apt/**/Dockerfile') }}
- name: Install dependencies
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
run: |
sudo apt update
sudo apt -V install ruby ruby-bundler ruby-serverspec
sudo gem install bundler:2.2.9 --no-document
sudo gem uninstall fileutils
- name: Build deb with Docker
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
run: |
rake apt:build APT_TARGETS=${{ matrix.rake-job }}
- name: Upload fluent-package deb
uses: actions/upload-artifact@master
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Upload fluent-apt-source deb
uses: actions/upload-artifact@master
with:
name: packages-apt-source-${{ matrix.rake-job }}
path: fluent-apt-source/apt/repositories
- name: Upload fluent-lts-apt-source deb
uses: actions/upload-artifact@master
with:
name: packages-lts-apt-source-${{ matrix.rake-job }}
path: fluent-lts-apt-source/apt/repositories
check_package_size:
name: Check Package Size
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Check Package Size
run: |
fluent-package/apt/pkgsize-test.sh ${{ matrix.rake-job }} amd64
installation_test:
name: Installation Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Installation Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/install-test.sh
piuparts_test:
name: Piuparts Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Piuparts (Install/Remove/Upgrade) Test
run: |
mkdir -p .bundle
docker run \
--privileged \
--rm \
--tty \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/piuparts-test.sh
serverspec_test:
name: Serverspec Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Serverspec Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/serverspec-test.sh
confluent_test:
name: Confluent Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Confluent Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/confluent-test.sh
binstubs_test:
name: Binstubs Test
needs: [define-matrix, build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Binstubs Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/binstubs-test.sh
test:
name: Test ${{ matrix.label }} ${{ matrix.test-file }}
needs: [check_package_size, installation_test, piuparts_test, serverspec_test, confluent_test, binstubs_test]
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
label:
- Debian bullseye amd64
- Debian bookworm amd64
- Ubuntu Focal amd64
- Ubuntu Jammy amd64
- Ubuntu Noble amd64
test-file:
- "update-from-v4.sh"
- "update-to-next-version-with-backward-compat-for-v4.sh"
- "downgrade-to-v4.sh"
- "install-newly.sh local"
- "install-newly.sh v5"
- "install-newly.sh lts"
include:
- label: Debian bullseye amd64
rake-job: debian-bullseye
container-image: images:debian/11
- label: Debian bookworm amd64
rake-job: debian-bookworm
container-image: images:debian/12
- label: Ubuntu Focal amd64
rake-job: ubuntu-focal
container-image: images:ubuntu/20.04
- label: Ubuntu Jammy amd64
rake-job: ubuntu-jammy
container-image: images:ubuntu/22.04
- label: Ubuntu Noble amd64
rake-job: ubuntu-noble
container-image: images:ubuntu/24.04
exclude:
- label: Debian bookworm amd64
test-file: update-from-v4.sh
- label: Debian bookworm amd64
test-file: update-to-next-version-with-backward-compat-for-v4.sh
- label: Debian bookworm amd64
test-file: downgrade-to-v4.sh
- label: Ubuntu Noble amd64
test-file: update-from-v4.sh
- label: Ubuntu Noble amd64
test-file: update-to-next-version-with-backward-compat-for-v4.sh
- label: Ubuntu Noble amd64
test-file: downgrade-to-v4.sh
- label: Ubuntu Noble amd64
test-file: install-newly.sh v5
- label: Ubuntu Noble amd64
test-file: install-newly.sh lts
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: packages-apt-source-${{ matrix.rake-job }}
- name: Setup Incus
run: |
sudo apt update
sudo apt install -y -V incus
- name: Allow egress network traffic flows for Incus
# https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker
run: |
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Setup Incus
run: |
sudo incus admin init --auto
- name: Run Test ${{ matrix.test-file }} on ${{ matrix.container-image }}
run: fluent-package/apt/systemd-test/test.sh ${{ matrix.container-image }} ${{ matrix.test-file }}