File tree Expand file tree Collapse file tree 2 files changed +44
-4
lines changed
Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 1+ import os
2+ import json
3+
4+ TEST_DIR = "bin/icp-cli/tests"
5+
6+ MACOS_TESTS = ["hello_tests" ]
7+
8+ def test_names ():
9+ all_files = os .listdir (TEST_DIR )
10+ rust_files = filter (lambda f : f .endswith (".rs" ), all_files )
11+ return [f"{ filename [:- 3 ]} " for filename in rust_files ]
12+
13+ include = []
14+ for test in test_names ():
15+ # Ubuntu: run everything
16+ include .append ({
17+ "test" : test ,
18+ "os" : "ubuntu-22.04"
19+ })
20+
21+ # macOS: only run selected tests
22+ if test in MACOS_TESTS :
23+ include .append ({
24+ "test" : test ,
25+ "os" : "macos-13"
26+ })
27+
28+
29+ matrix = {
30+ "include" : include ,
31+ }
32+
33+ print (json .dumps (matrix ))
Original file line number Diff line number Diff line change 77 pull_request :
88
99jobs :
10+ discover :
11+ runs-on : ubuntu-latest
12+ outputs :
13+ matrix : ${{ steps.set-matrix.outputs.matrix }}
14+ steps :
15+ - uses : actions/checkout@v4
16+ - id : set-matrix
17+ run : echo "matrix=$(python3 .github/scripts/test-matrix.py)" >> $GITHUB_OUTPUT
18+
1019 test :
1120 name : ${{ matrix.test }} on ${{ matrix.os }}
21+ needs : discover
1222 runs-on : ${{ matrix.os }}
1323 strategy :
1424 fail-fast : false
15- matrix :
16- os : [ubuntu-latest, macos-latest]
17- test :
18- - hello_tests
25+ matrix : ${{fromJson(needs.discover.outputs.matrix)}}
1926
2027 steps :
2128 - uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments