Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7574605

Browse files
committedMay 14, 2024··
Merge branch 'bugfix/wokwi_concurrency'
2 parents cb968a7 + cce7419 commit 7574605

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed
 

‎.github/workflows/hil.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@ jobs:
270270
271271
event_file:
272272
name: "Event File"
273-
if: |
274-
contains(github.event.pull_request.labels.*.name, 'hil_test') ||
275-
contains(github.event.pull_request.labels.*.name, 'perf_test') ||
276-
github.event_name == 'schedule'
277-
needs: hardware-test
278273
runs-on: ubuntu-latest
279274
steps:
280275
- name: Upload

‎.github/workflows/wokwi.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,38 @@ env:
1515
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717

18-
concurrency:
19-
group: wokwi-${{github.event.pull_request.number || github.ref}}
20-
cancel-in-progress: true
21-
2218
jobs:
19+
get_event_file:
20+
name: Get event file
21+
runs-on: ubuntu-latest
22+
outputs:
23+
ref: ${{ steps.get-ref.outputs.ref }}
24+
steps:
25+
- name: Download event file
26+
uses: actions/download-artifact@v4
27+
with:
28+
run-id: ${{github.event.workflow_run.id}}
29+
github-token: ${{env.GITHUB_TOKEN}}
30+
name: Event File
31+
path: ${{github.event_path}}
32+
33+
- name: Get ref
34+
id: get-ref
35+
run: |
36+
PR_NUMBER=$(jq -r '.number' ${{github.event_path}}/event.json)
37+
echo "PR_NUMBER = $PR_NUMBER"
38+
echo "ref=$PR_NUMBER" >> $GITHUB_OUTPUT
39+
2340
gen_chunks:
2441
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
2542
name: Generate Chunks matrix
2643
runs-on: ubuntu-latest
44+
needs: get_event_file
2745
outputs:
2846
chunks: ${{ steps.gen-chunks.outputs.chunks }}
47+
concurrency:
48+
group: wokwi-${{ needs.get_event_file.outputs.ref || github.ref }}
49+
cancel-in-progress: true
2950
steps:
3051
- name: Checkout Repository
3152
uses: actions/checkout@v4
@@ -47,7 +68,7 @@ jobs:
4768
echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
4869
4970
wokwi-test:
50-
needs: [gen_chunks]
71+
needs: gen_chunks
5172
name: ${{matrix.chip}}-Wokwi_Test#${{matrix.chunks}}
5273
strategy:
5374
fail-fast: false
@@ -127,4 +148,4 @@ jobs:
127148
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
128149
})).data;
129150
core.info(`${name} is ${state}`);
130-
151+

0 commit comments

Comments
 (0)
Please sign in to comment.