Skip to content

Commit 25b4baf

Browse files
committed
chore(ci/cd): improve build
1 parent bad7e30 commit 25b4baf

1 file changed

Lines changed: 72 additions & 2 deletions

File tree

.github/workflows/lf-linux-test.yml

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,20 @@ jobs:
7575
with:
7676
egress-policy: audit
7777

78+
- name: 'Check directory existence'
79+
id: 'check_dir'
80+
run: |
81+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
82+
echo "exists=true" >> $GITHUB_ENV
83+
else
84+
echo "exists=false" >> $GITHUB_ENV
85+
fi
86+
7887
- name: 'mkdir ${{ env.BASE_DIR }}/output/debian11'
7988
run: 'mkdir ${{ env.BASE_DIR }}/output/debian11'
8089

8190
- name: 'Test on Debian 11'
91+
if: 'env.exists == "true"'
8292
run: |-
8393
podman run --interactive --rm \
8494
--mount type=bind,source=${{ env.BASE_DIR }}/output/debian11,destination=/output,relabel=private \
@@ -101,10 +111,20 @@ jobs:
101111
with:
102112
egress-policy: audit
103113

114+
- name: 'Check directory existence'
115+
id: 'check_dir'
116+
run: |
117+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
118+
echo "exists=true" >> $GITHUB_ENV
119+
else
120+
echo "exists=false" >> $GITHUB_ENV
121+
fi
122+
104123
- name: 'mkdir ${{ env.BASE_DIR }}/output/debian12'
105124
run: 'mkdir ${{ env.BASE_DIR }}/output/debian12'
106125

107126
- name: 'Test on RHEL8'
127+
if: 'env.exists == "true"'
108128
run: |-
109129
podman run --interactive --rm \
110130
--mount type=bind,source=${{ env.BASE_DIR }}/output/debian12,destination=/output,relabel=private \
@@ -128,15 +148,25 @@ jobs:
128148
with:
129149
egress-policy: audit
130150

151+
- name: 'Check directory existence'
152+
id: 'check_dir'
153+
run: |
154+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
155+
echo "exists=true" >> $GITHUB_ENV
156+
else
157+
echo "exists=false" >> $GITHUB_ENV
158+
fi
159+
131160
- name: 'mkdir ${{ env.BASE_DIR }}/output/rocky8'
132161
run: 'mkdir ${{ env.BASE_DIR }}/output/rocky8'
133162

134163
- name: 'Test on RHEL8'
164+
if: 'env.exists == "true"'
135165
run: |-
136166
podman run --interactive --rm \
137167
--mount type=bind,source=${{ env.BASE_DIR }}/output/rocky8,destination=/output,relabel=private \
138168
--mount type=bind,source=${{ env.BASE_DIR }}/repos,destination=/repos,relabel=shared,ro=true \
139-
--mount type=bind,source=${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/rhel8,destination=/packages,relabel=shared,ro=true \
169+
--mount type=bind,source=${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/rocky8,destination=/packages,relabel=shared,ro=true \
140170
registry.access.redhat.com/ubi8/ubi /bin/bash -x /repos/monitoring-plugins/testing/rhel/run-all
141171
142172
@@ -154,15 +184,25 @@ jobs:
154184
with:
155185
egress-policy: audit
156186

187+
- name: 'Check directory existence'
188+
id: 'check_dir'
189+
run: |
190+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
191+
echo "exists=true" >> $GITHUB_ENV
192+
else
193+
echo "exists=false" >> $GITHUB_ENV
194+
fi
195+
157196
- name: 'mkdir ${{ env.BASE_DIR }}/output/rocky9'
158197
run: 'mkdir ${{ env.BASE_DIR }}/output/rocky9'
159198

160199
- name: 'Test on RHEL8'
200+
if: 'env.exists == "true"'
161201
run: |-
162202
podman run --interactive --rm \
163203
--mount type=bind,source=${{ env.BASE_DIR }}/output/rocky9,destination=/output,relabel=private \
164204
--mount type=bind,source=${{ env.BASE_DIR }}/repos,destination=/repos,relabel=shared,ro=true \
165-
--mount type=bind,source=${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/rhel9,destination=/packages,relabel=shared,ro=true \
205+
--mount type=bind,source=${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/rocky9,destination=/packages,relabel=shared,ro=true \
166206
registry.access.redhat.com/ubi9/ubi /bin/bash -x /repos/monitoring-plugins/testing/rhel/run-all
167207
168208
@@ -181,10 +221,20 @@ jobs:
181221
with:
182222
egress-policy: audit
183223

224+
- name: 'Check directory existence'
225+
id: 'check_dir'
226+
run: |
227+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
228+
echo "exists=true" >> $GITHUB_ENV
229+
else
230+
echo "exists=false" >> $GITHUB_ENV
231+
fi
232+
184233
- name: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2004'
185234
run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2004'
186235

187236
- name: 'Test on Ubuntu 20.04'
237+
if: 'env.exists == "true"'
188238
run: |-
189239
podman run --interactive --rm \
190240
--mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2004,destination=/output,relabel=private \
@@ -207,10 +257,20 @@ jobs:
207257
with:
208258
egress-policy: audit
209259

260+
- name: 'Check directory existence'
261+
id: 'check_dir'
262+
run: |
263+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
264+
echo "exists=true" >> $GITHUB_ENV
265+
else
266+
echo "exists=false" >> $GITHUB_ENV
267+
fi
268+
210269
- name: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2204'
211270
run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2204'
212271

213272
- name: 'Test on Ubuntu 22.04'
273+
if: 'env.exists == "true"'
214274
run: |-
215275
podman run --interactive --rm \
216276
--mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2204,destination=/output,relabel=private \
@@ -233,10 +293,20 @@ jobs:
233293
with:
234294
egress-policy: audit
235295

296+
- name: 'Check directory existence'
297+
id: 'check_dir'
298+
run: |
299+
if [ -d "${{ env.BASE_DIR }}/monitoring-plugins-linux-packages/ubuntu2004" ]; then
300+
echo "exists=true" >> $GITHUB_ENV
301+
else
302+
echo "exists=false" >> $GITHUB_ENV
303+
fi
304+
236305
- name: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2404'
237306
run: 'mkdir ${{ env.BASE_DIR }}/output/ubuntu2404'
238307

239308
- name: 'Test on Ubuntu 24.04'
309+
if: 'env.exists == "true"'
240310
run: |-
241311
podman run --interactive --rm \
242312
--mount type=bind,source=${{ env.BASE_DIR }}/output/ubuntu2404,destination=/output,relabel=private \

0 commit comments

Comments
 (0)