@@ -3,54 +3,77 @@ name: tests
33on :
44 pull_request :
55 branches :
6- - ' * '
6+ - " * "
77 push :
88 branches :
9- - ' main'
9+ - " main"
1010 tags :
11- - ' * '
11+ - " * "
1212 workflow_dispatch : {}
1313
1414jobs :
15- unit-tests :
15+ generators :
1616 runs-on : ubuntu-latest
1717 steps :
18+ - name : checkout repository
19+ uses : actions/checkout@v3
20+ with :
21+ fetch-depth : 0
22+
23+ - name : install rust
24+ uses : actions-rs/toolchain@v1
25+ with :
26+ toolchain : stable
27+ override : true
1828
19- - name : checkout repository
20- uses : actions/checkout@v3
21- with :
22- fetch-depth : 0
29+ - name : install kopium
30+ run : cargo install kopium --version 0.22.5
2331
24- - name : install rust
25- uses : actions-rs/toolchain@v1
26- with :
27- toolchain : stable
28- override : true
32+ - name : run generators
33+ run : make generate
2934
30- - name : run unit tests
31- uses : actions-rs/cargo@v1
32- with :
33- command : test
34- args : -v -- --nocapture
35+ - name : check for uncommitted changes
36+ run : |
37+ git diff --exit-code || (echo "Generator produced changes. Please run 'make generate' locally and commit the results." && exit 1)
38+
39+ unit-tests :
40+ runs-on : ubuntu-latest
41+ needs : generators
42+ steps :
43+ - name : checkout repository
44+ uses : actions/checkout@v3
45+ with :
46+ fetch-depth : 0
47+
48+ - name : install rust
49+ uses : actions-rs/toolchain@v1
50+ with :
51+ toolchain : stable
52+ override : true
53+
54+ - name : run unit tests
55+ uses : actions-rs/cargo@v1
56+ with :
57+ command : test
58+ args : -v -- --nocapture
3559
3660 integration-tests :
3761 runs-on : ubuntu-latest
38- needs : unit-tests
62+ needs : [generators, unit-tests]
3963 steps :
64+ - name : checkout repository
65+ uses : actions/checkout@v3
66+ with :
67+ fetch-depth : 0
68+
69+ - name : install rust
70+ uses : actions-rs/toolchain@v1
71+ with :
72+ toolchain : stable
73+ override : true
4074
41- - name : checkout repository
42- uses : actions/checkout@v3
43- with :
44- fetch-depth : 0
45-
46- - name : install rust
47- uses : actions-rs/toolchain@v1
48- with :
49- toolchain : stable
50- override : true
51-
52- - name : run integration tests
53- uses : actions-rs/cargo@v1
54- with :
55- command : test
56- args : -v -- --nocapture --ignored
75+ - name : run integration tests
76+ uses : actions-rs/cargo@v1
77+ with :
78+ command : test
79+ args : -v -- --nocapture --ignored
0 commit comments