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-
2218jobs :
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+
32+ - name : Get ref
33+ id : get-ref
34+ run : |
35+ PR_NUMBER=$(jq -r '.number' event.json)
36+ echo "PR_NUMBER = $PR_NUMBER"
37+ echo "ref=$PR_NUMBER" >> $GITHUB_OUTPUT
38+
2339 gen_chunks :
2440 if : github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
2541 name : Generate Chunks matrix
2642 runs-on : ubuntu-latest
43+ needs : get_event_file
2744 outputs :
2845 chunks : ${{ steps.gen-chunks.outputs.chunks }}
46+ concurrency :
47+ group : wokwi-${{ needs.get_event_file.outputs.ref || github.ref }}
48+ cancel-in-progress : true
2949 steps :
3050 - name : Checkout Repository
3151 uses : actions/checkout@v4
4767 echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
4868
4969 wokwi-test :
50- needs : [gen_chunks]
70+ needs : [get_event_file, gen_chunks]
5171 name : ${{matrix.chip}}-Wokwi_Test#${{matrix.chunks}}
72+ concurrency :
73+ group : wokwi-${{ needs.get_event_file.outputs.ref || github.ref }}-${{matrix.chip}}-${{matrix.chunks}}
74+ cancel-in-progress : true
5275 strategy :
5376 fail-fast : false
5477 matrix :
@@ -101,7 +124,10 @@ jobs:
101124 report-result :
102125 name : Report wokwi test result
103126 runs-on : ubuntu-latest
104- needs : wokwi-test
127+ needs : [get_event_file, wokwi-test]
128+ concurrency :
129+ group : wokwi-${{ needs.get_event_file.outputs.ref || github.ref }}
130+ cancel-in-progress : true
105131 if : always() && github.event.workflow_run.event == 'pull_request'
106132 steps :
107133 - name : Report result
@@ -127,4 +153,4 @@ jobs:
127153 target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
128154 })).data;
129155 core.info(`${name} is ${state}`);
130-
156+
0 commit comments