Skip to content

Commit

Permalink
workflows: use safe-upload-artifacts for twister
Browse files Browse the repository at this point in the history
Use safe-upload-artifacts for twister run artifacts and summaries.

Signed-off-by: Mike Szczys <mike@golioth.io>
  • Loading branch information
szczys committed Sep 18, 2024
1 parent b235ae4 commit 87401e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/hil_sample_zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,12 @@ jobs:
--pytest-args="--hil-board=${{ inputs.hil_board }}" \
-v
- name: Mask secrets in logs
id: mask-logs
- name: Safe upload twister artifacts
id: safe-upload-artifacts
if: always()
uses: ./modules/lib/golioth-firmware-sdk/.github/actions/mask_secrets
uses: ./modules/lib/golioth-firmware-sdk/.github/actions/safe-upload-artifacts
with:
secrets-json: ${{ toJson(secrets) }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always() && steps.mask-logs.outcome == 'success'
with:
name: twister-run-artifacts-${{ inputs.hil_board }}
path: |
reports/*
Expand All @@ -225,15 +220,15 @@ jobs:
twister-out/*.json
- name: Prepare CI report summary
if: always() && steps.mask-logs.outcome == 'success'
if: always()
run: |
rm -rf summary
mkdir summary
cp twister-out/twister_suite_report.xml summary/samples-zephyr-${{ inputs.hil_board }}.xml
- name: Upload CI report summary
uses: actions/upload-artifact@v4
if: always() && steps.mask-logs.outcome == 'success'
- name: Safe upload CI report summary
uses: ./modules/lib/golioth-firmware-sdk/.github/actions/safe-upload-artifacts
if: always()
with:
name: ci-summary-samples-zephyr-${{ inputs.hil_board }}
path: summary/*
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/hil_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,12 @@ jobs:
--pytest-args="--runner-name=${{ runner.name }}" \
--pytest-args="--hil-board=${{ matrix.artifact_suffix }}"
- name: Mask secrets in logs
id: mask-logs
- name: Safe upload twister artifacts
id: safe-upload-artifacts
if: always()
uses: ./modules/lib/golioth-firmware-sdk/.github/actions/mask_secrets
uses: ./modules/lib/golioth-firmware-sdk/.github/actions/safe-upload-artifacts
with:
secrets-json: ${{ toJson(secrets) }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always() && steps.mask-logs.outcome == 'success'
with:
name: twister-run-artifacts-${{ matrix.artifact_suffix }}
path: |
reports/*
Expand All @@ -253,19 +248,18 @@ jobs:
twister-out/*.json
- name: Prepare CI report summary
if: always() && steps.mask-logs.outcome == 'success'
if: always()
run: |
rm -rf summary
mkdir summary
cp twister-out/twister_suite_report.xml summary/samples-zephyr-${{ matrix.artifact_suffix }}.xml
- name: Upload CI report summary
uses: actions/upload-artifact@v4
if: always() && steps.mask-logs.outcome == 'success'
- name: Safe upload CI report summary
uses: ./modules/lib/golioth-firmware-sdk/.github/actions/safe-upload-artifacts
if: always()
with:
name: ci-summary-samples-zephyr-${{ matrix.artifact_suffix }}
path: |
summary/*
path: summary/*

- name: Upload Allure reports
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 87401e4

Please sign in to comment.