Skip to content

Commit 527102a

Browse files
committed
test runner tags
1 parent 44ef88d commit 527102a

File tree

10 files changed

+622
-183
lines changed

10 files changed

+622
-183
lines changed

.github/workflows/tests_hw_wokwi.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
core.info(`${name} is ${state}`);
193193
194194
hardware-test:
195-
name: Hardware ${{ matrix.chip }} ${{ matrix.type }} tests
195+
name: Internal Hardware Tests
196196
if: |
197197
(github.event.workflow_run.conclusion == 'success' ||
198198
github.event.workflow_run.conclusion == 'failure' ||
@@ -201,15 +201,10 @@ jobs:
201201
runs-on: ubuntu-latest
202202
needs: get-artifacts
203203
env:
204-
id: ${{ needs.get-artifacts.outputs.ref }}-${{ github.event.workflow_run.head_sha || github.sha }}-${{ matrix.chip }}-${{ matrix.type }}
204+
id: ${{ needs.get-artifacts.outputs.ref }}-${{ github.event.workflow_run.head_sha || github.sha }}
205205
permissions:
206206
actions: read
207207
statuses: write
208-
strategy:
209-
fail-fast: false
210-
matrix:
211-
type: ${{ fromJson(needs.get-artifacts.outputs.types) }}
212-
chip: ${{ fromJson(needs.get-artifacts.outputs.targets) }}
213208
steps:
214209
- name: Report pending
215210
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -222,7 +217,7 @@ jobs:
222217
core.debug(`repo: ${repo}`);
223218
core.debug(`sha: ${sha}`);
224219
const { context: name, state } = (await github.rest.repos.createCommitStatus({
225-
context: 'Runtime Tests / Hardware (${{ matrix.type }}, ${{ matrix.chip }}) / Hardware ${{ matrix.chip }} ${{ matrix.type }} tests (${{ github.event.workflow_run.event }} -> workflow_run)',
220+
context: 'Runtime Tests / Internal Hardware Tests (${{ github.event.workflow_run.event }} -> workflow_run)',
226221
owner: owner,
227222
repo: repo,
228223
sha: sha,
@@ -261,8 +256,7 @@ jobs:
261256
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
262257
run: |
263258
# A webhook to sync the repository is sent to GitLab when a commit is pushed to GitHub
264-
# In the worst case, it can take up to 5 minutes for the sync to complete
265-
# We wait for 6 minutes after the push to GitHub to be safe
259+
# We wait for 10 minutes after the push to GitHub to be safe
266260
267261
echo "Ensuring GitLab sync has completed before triggering pipeline..."
268262
@@ -281,8 +275,8 @@ jobs:
281275
282276
echo "Elapsed time since push: ${elapsed_minutes} minutes"
283277
284-
if [ $elapsed_minutes -lt 6 ]; then
285-
wait_time=$(( (6 - elapsed_minutes) * 60 ))
278+
if [ $elapsed_minutes -lt 10 ]; then
279+
wait_time=$(( (10 - elapsed_minutes) * 60 ))
286280
echo "Waiting ${wait_time} seconds for GitLab sync to complete..."
287281
sleep $wait_time
288282
else
@@ -305,15 +299,6 @@ jobs:
305299
with:
306300
ref: ${{ needs.get-artifacts.outputs.base || github.ref }}
307301

308-
- name: Get test binaries
309-
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
310-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
311-
with:
312-
github-token: ${{ secrets.GITHUB_TOKEN }}
313-
run-id: ${{ github.event.workflow_run.id }}
314-
name: test-bin-${{ matrix.chip }}-${{ matrix.type }}
315-
path: test-binaries
316-
317302
- name: Trigger GitLab Pipeline and Download Artifacts
318303
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
319304
uses: digital-blueprint/[email protected]
@@ -328,7 +313,7 @@ jobs:
328313
download_artifacts: 'true'
329314
download_artifacts_on_failure: 'true'
330315
download_path: './gitlab-artifacts'
331-
variables: '{"TEST_TYPE":"${{ matrix.type }}","TEST_CHIP":"${{ matrix.chip }}","PIPELINE_ID":"${{ env.id }}","BINARIES_RUN_ID":"${{ github.event.workflow_run.id }}","GITHUB_REPOSITORY":"${{ github.repository }}"}'
316+
variables: '{"TEST_TYPES":"${{ needs.get-artifacts.outputs.types }}","TEST_CHIPS":"${{ needs.get-artifacts.outputs.targets }}","PIPELINE_ID":"${{ env.id }}","BINARIES_RUN_ID":"${{ github.event.workflow_run.id }}","GITHUB_REPOSITORY":"${{ github.repository }}"}'
332317

333318
- name: Process Downloaded Artifacts
334319
if: ${{ always() && steps.check-tests.outputs.enabled == 'true' }}
@@ -359,7 +344,7 @@ jobs:
359344
echo "No artifacts were downloaded from GitLab"
360345
fi
361346
362-
- name: Upload ${{ matrix.chip }} ${{ matrix.type }} hardware results as cache
347+
- name: Upload hardware results as cache
363348
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
364349
if: steps.check-tests.outputs.enabled == 'true' && needs.get-artifacts.outputs.pr_num
365350
with:
@@ -368,11 +353,11 @@ jobs:
368353
tests/**/*.xml
369354
tests/**/result_*.json
370355
371-
- name: Upload ${{ matrix.chip }} ${{ matrix.type }} hardware results as artifacts
356+
- name: Upload hardware results as artifacts
372357
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
373358
if: always()
374359
with:
375-
name: test-results-hw-${{ matrix.chip }}-${{ matrix.type }}
360+
name: test-results-hw
376361
overwrite: true
377362
path: |
378363
tests/**/*.xml
@@ -390,7 +375,7 @@ jobs:
390375
core.debug(`repo: ${repo}`);
391376
core.debug(`sha: ${sha}`);
392377
const { context: name, state } = (await github.rest.repos.createCommitStatus({
393-
context: 'Runtime Tests / Hardware (${{ matrix.type }}, ${{ matrix.chip }}) / Hardware ${{ matrix.chip }} ${{ matrix.type }} tests (${{ github.event.workflow_run.event }} -> workflow_run)',
378+
context: 'Runtime Tests / Internal Hardware Tests (${{ github.event.workflow_run.event }} -> workflow_run)',
394379
owner: owner,
395380
repo: repo,
396381
sha: sha,

.gitlab-ci.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
workflow:
22
rules:
3-
# Disable those non-protected push triggered pipelines
4-
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
5-
when: never
6-
# when running merged result pipelines, CI_COMMIT_SHA represents the temp commit it created.
7-
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha of the original commit.
8-
- if: $CI_OPEN_MERGE_REQUESTS != null
9-
variables:
10-
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
11-
IS_MR_PIPELINE: 1
12-
- if: $CI_OPEN_MERGE_REQUESTS == null
13-
variables:
14-
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
15-
IS_MR_PIPELINE: 0
16-
- if: '$CI_PIPELINE_SOURCE == "schedule"'
17-
variables:
18-
IS_SCHEDULED_RUN: "true"
19-
- when: always
3+
# Allow only when triggered manually (web), via API, or by a trigger token
4+
- if: '$CI_PIPELINE_SOURCE =~ /^(trigger|api|web)$/'
5+
when: always
6+
# Deny all other sources
7+
- when: never
208

219
# Place the default settings in `.gitlab/workflows/common.yml` instead
2210

2311
include:
2412
- ".gitlab/workflows/common.yml"
25-
- ".gitlab/workflows/hardware_tests.yml"
13+
- ".gitlab/workflows/hardware_tests_dynamic.yml"

0 commit comments

Comments
 (0)