Skip to content

Commit 01d2815

Browse files
committed
fix(ci): tests: Prefer artfact over checkout action
CodeQL complain about it, and GH suggests to use assets, It is unclear to me how this can be exploited in fork on job without pull_request_target (that one could be exploited). Anyway this workflow requieres permissions: - Workflows (RW) Origin: SiliconLabsSoftware#123 Signed-off-by: Philippe Coval <[email protected]>
1 parent c7e3e2f commit 01d2815

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,13 @@ jobs:
5858
# yamllint disable-line
5959
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}
6060
path: dist/
61+
62+
- name: Upload tests artifacts
63+
# yamllint disable-line rule:line-length
64+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
65+
with:
66+
# yamllint disable-line
67+
name: ${{ github.event.repository.name }}-tests
68+
path: |
69+
scripts/tests
70+
docker-compose.yml

.github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
rm -rfv "${{env.file}}"
4747
echo "TODO: https://docs.docker.com/engine/security/trust/"
4848
# yamllint enable rule:line-length
49-
# yamllint disable-line rule:line-length
5049

5150
- name: Download embedded applications package
5251
# yamllint disable-line rule:line-length
@@ -74,14 +73,21 @@ jobs:
7473
&& rm z-wave-stack-binaries-*-Linux.tar.gz
7574
&& date -u
7675
77-
- name: Download tests files
78-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76+
- name: Download tests artifacts
77+
id: tests
78+
# yamllint disable-line rule:line-length
79+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
7980
with:
80-
fetch-depth: 0
81-
ref: ${{ github.event.workflow_run.head_commit.id }}
81+
name: ${{ github.event.repository.name }}-tests
82+
github-token: ${{ secrets.GH_SL_ACCESS_TOKEN }}
83+
run-id: ${{ github.event.workflow_run.id }}
84+
path: ${{ runner.temp }}
8285

8386
- name: Run
8487
id: run
88+
working-directory: ${{ runner.temp }}
89+
env:
90+
file: ${{ runner.temp }}/scripts/tests/z-wave-stack-binaries-test.sh
8591
# yamllint disable rule:line-length
8692
run: |
8793
set -x
@@ -92,7 +98,7 @@ jobs:
9298
export ZPC_COMMAND="docker-compose up --abort-on-container-exit"
9399
export z_wave_stack_binaries_bin_dir="${{ runner.temp }}/z-wave-stack-binaries/bin"
94100
export ZPC_ARGS="--log.level=d"
95-
./scripts/tests/z-wave-stack-binaries-test.sh
101+
${{ env.file }}
96102
# yamllint enable rule:line-length
97103
continue-on-error: true
98104

0 commit comments

Comments
 (0)