15
15
WOKWI_CLI_TOKEN : ${{ secrets.WOKWI_CLI_TOKEN }}
16
16
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
17
17
18
- concurrency :
19
- group : wokwi-${{github.event.pull_request.number || github.ref}}
20
- cancel-in-progress : true
21
-
22
18
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
+
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
+
23
39
gen_chunks :
24
40
if : github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
25
41
name : Generate Chunks matrix
26
42
runs-on : ubuntu-latest
43
+ needs : get_event_file
27
44
outputs :
28
45
chunks : ${{ steps.gen-chunks.outputs.chunks }}
46
+ concurrency :
47
+ group : wokwi-${{ needs.get_event_file.outputs.ref || github.ref }}
48
+ cancel-in-progress : true
29
49
steps :
30
50
- name : Checkout Repository
31
51
uses : actions/checkout@v4
47
67
echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
48
68
49
69
wokwi-test :
50
- needs : [gen_chunks]
70
+ needs : [get_event_file, gen_chunks]
51
71
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
52
75
strategy :
53
76
fail-fast : false
54
77
matrix :
@@ -101,7 +124,10 @@ jobs:
101
124
report-result :
102
125
name : Report wokwi test result
103
126
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
105
131
if : always() && github.event.workflow_run.event == 'pull_request'
106
132
steps :
107
133
- name : Report result
@@ -127,4 +153,4 @@ jobs:
127
153
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
128
154
})).data;
129
155
core.info(`${name} is ${state}`);
130
-
156
+
0 commit comments