Skip to content

Commit 23785ca

Browse files
committed
Github Artifact Cleanup
Removed artifacting of log files and combined wasm artifact uploads into a singluar artifact. Currently the build wasm step saves all artifacts to a directory local on disk and they are artifacted in a seperate step. The directory used is cleaned at the end of the workflow to prevent runs from affecting each other. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
1 parent a99ab63 commit 23785ca

1 file changed

Lines changed: 59 additions & 30 deletions

File tree

.github/workflows/build.yml

Lines changed: 59 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
runs-on: zephyr-xlarge-runner
136136
container:
137137
image: ghcr.io/zephyrproject-rtos/ci:v0.26-branch
138-
options: --user root
138+
options: --user root -v /var/ocre-ci-files/:/var/ocre-ci-files/
139139
strategy:
140140
matrix:
141141
sample:
@@ -203,15 +203,34 @@ jobs:
203203
env:
204204
WASI_SDK_PATH: /opt/wasi-sdk
205205

206-
- name: Upload .wasm artifact
206+
# Replace with cp to /var/ocre-ci-files
207+
# - name: Upload .wasm artifact
208+
# if: always()
209+
# uses: actions/upload-artifact@v4
210+
# with:
211+
# name: "${{ matrix.sample.name }}"
212+
# path: "ocre-sdk/${{ matrix.sample.path }}/build/${{ matrix.sample.filename }}"
213+
214+
# Saving files to the runner so avoid uploading .wasm files as artifacts
215+
- name: Save .wasm artifact locally
216+
if: always()
217+
run: cp "ocre-sdk/${{ matrix.sample.path }}/build/${{ matrix.sample.filename }}" "/var/ocre-ci-files/wasm/${{ matrix.sample.filename }}"
218+
219+
artifact-wasm-files:
220+
needs: build-wasm-files
221+
runs-on: zephyr-xlarge-runner
222+
steps:
223+
- name: Artifact local wasm files
207224
if: always()
208225
uses: actions/upload-artifact@v4
209226
with:
210-
name: "${{ matrix.sample.name }}"
211-
path: "ocre-sdk/${{ matrix.sample.path }}/build/${{ matrix.sample.filename }}"
227+
name: wasm-build-artifacts
228+
path: "/var/ocre-ci/files/wasm"
229+
230+
212231

213232
build-and-run-linux-sample:
214-
needs: build-wasm-files
233+
needs: artifact-wasm-files
215234
runs-on: ubuntu-latest
216235
strategy:
217236
matrix:
@@ -236,8 +255,9 @@ jobs:
236255
- name: Download wasm artifact
237256
uses: actions/download-artifact@v4
238257
with:
239-
name: "${{ matrix.sample.name }}"
240-
path: ${{ matrix.sample.name }}
258+
name: wasm-build-artifacts
259+
path: wasm-build-artifacts
260+
241261

242262
- name: Update Submodules
243263
working-directory: application
@@ -254,7 +274,7 @@ jobs:
254274
working-directory: application/build
255275
run: |
256276
echo "=== Running sample: ${{ matrix.sample.name }} ==="
257-
WASM_FILE=$GITHUB_WORKSPACE/${{ matrix.sample.name }}/${{ matrix.sample.build-file }}
277+
WASM_FILE=$GITHUB_WORKSPACE/wasm-build-artifacts/${{ matrix.sample.name }}/${{ matrix.sample.build-file }}
258278
chmod +x app
259279
stdbuf -oL -eL timeout 20s ./app $WASM_FILE | tee "${{ matrix.sample.name }}_run.log"
260280
@@ -268,7 +288,7 @@ jobs:
268288
269289
# Run zephyr agent on github actions runner
270290
build-and-run-zephyr-sample:
271-
needs: build-wasm-files
291+
needs: artifact-wasm-files
272292
runs-on: zephyr-xlarge-runner
273293
container:
274294
image: ghcr.io/zephyrproject-rtos/ci:v0.26-branch
@@ -312,11 +332,10 @@ jobs:
312332
sdk-version: 0.16.8
313333

314334
- name: Download wasm artifact
315-
if: runner.environment == 'self-hosted'
316335
uses: actions/download-artifact@v4
317336
with:
318-
name: "${{ matrix.sample.name }}"
319-
path: ${{ matrix.sample.name }}
337+
name: wasm-build-artifacts
338+
path: wasm-build-artifacts
320339

321340
- name: Update Submodules
322341
working-directory: application
@@ -326,7 +345,7 @@ jobs:
326345
- name: Build Zephyr app
327346
run: |
328347
echo "=== Build app ==="
329-
WASM_FILE=$GITHUB_WORKSPACE/${{ matrix.sample.name }}/${{ matrix.sample.build-file }}
348+
WASM_FILE=$GITHUB_WORKSPACE/wasm-build-artifacts/${{ matrix.sample.name }}/${{ matrix.sample.build-file }}
330349
west build --pristine -b native_sim ./application -d build -- \
331350
-DMODULE_EXT_ROOT=$(pwd)/application \
332351
-DOCRE_INPUT_FILE=$WASM_FILE
@@ -386,12 +405,13 @@ jobs:
386405
if: always()
387406
run: cat /tmp/flashValidation.log
388407

389-
- name: Upload log file as artifact
390-
if: always()
391-
uses: actions/upload-artifact@v4
392-
with:
393-
name: "FlashValidation.log"
394-
path: /tmp/flashValidation.log
408+
# Remove
409+
# - name: Upload log file as artifact
410+
# if: always()
411+
# uses: actions/upload-artifact@v4
412+
# with:
413+
# name: "FlashValidation.log"
414+
# path: /tmp/flashValidation.log
395415

396416

397417
build-zephyr-modbus_server-b_u585i_iot02a:
@@ -425,11 +445,11 @@ jobs:
425445
env:
426446
WASI_SDK_PATH: /opt/wasi-sdk
427447

428-
- name: Download WASM artifact
448+
- name: Download wasm artifact
429449
uses: actions/download-artifact@v4
430450
with:
431-
name: b_u585i-modbus-server
432-
path: b_u585i-modbus-server
451+
name: wasm-build-artifacts
452+
path: wasm-build-artifacts
433453

434454
- name: Setup Zephyr project
435455
uses: zephyrproject-rtos/action-zephyr-setup@v1
@@ -439,7 +459,7 @@ jobs:
439459

440460
- name: Build b_u585i_iot02a with modbus-server
441461
run: |
442-
WASM_FILE=$GITHUB_WORKSPACE/b_u585i-modbus-server/modbus-server.wasm
462+
WASM_FILE=$GITHUB_WORKSPACE/wasm-build-artifacts/b_u585i-modbus-server/modbus-server.wasm
443463
west -v build --pristine=auto -b b_u585i_iot02a ./application -d build -- \
444464
-DMODULE_EXT_ROOT=$(pwd)/application \
445465
-DOCRE_INPUT_FILE=$WASM_FILE \
@@ -487,10 +507,19 @@ jobs:
487507
if: always()
488508
run: cat /tmp/modbusServerValidation.log
489509

490-
- name: Upload log file as artifact
491-
if: always()
492-
uses: actions/upload-artifact@v4
493-
with:
494-
name: "ModbusServerValidation.log"
495-
path: /tmp/modbusServerValidation.log
496-
510+
# Remove
511+
# - name: Upload log file as artifact
512+
# if: always()
513+
# uses: actions/upload-artifact@v4
514+
# with:
515+
# name: "ModbusServerValidation.log"
516+
# path: /tmp/modbusServerValidation.log
517+
518+
519+
runner-cleanup:
520+
# All non-blocking jobs
521+
needs: [modbus-server-validation-tests, run-zephyr-base-native-sim, build-and-run-linux-sample, build-and-run-zephyr-sample, run-linux-base]
522+
runs-on: zephyr-xlarge-runner
523+
steps:
524+
- name: Remove old workflow files
525+
run: rm -rf /var/ocre-ci-files/*

0 commit comments

Comments
 (0)