11name : build
22
3- # This should ensure that the workflow won't run on `dev-*` branches, but will
4- # otherwise execute on any other branch and any pull request (including PRs
5- # from dev branches).
3+ # This should ensure that the workflow won't run on `feat/*`, `fix/*` and `chore/*` branches, but will
4+ # otherwise execute on any other branch and any pull request.
65on :
76 push :
87 branches-ignore :
9- - ' dev-*'
8+ - ' **/feat/*'
9+ - ' **/fix/*'
10+ - ' **/chore/*'
1011 pull_request :
1112 branches :
1213 - ' *'
1314
14- env :
15- # A fixed version used for testing, so that the builds don't
16- # spontaneously break after a few years.
17- # Make sure to update this from time to time.
18- RUST_VERSION : " 1.86.0"
1915jobs :
20- # Checks syntax formatting.
21- fmt :
22- name : Rustfmt
23- runs-on : ubuntu-latest
24- env :
25- RUSTFLAGS : " -D warnings"
26- steps :
27- - uses : actions/checkout@v4
28- - uses : dtolnay/rust-toolchain@stable
29- with :
30- toolchain : ${{ env.RUST_VERSION }}
31- components : rustfmt
32- - run : cargo fmt --all -- --check
33-
34- # Run basic code validity check.
35- check :
36- needs : fmt
37- name : Check
38- runs-on : ubuntu-latest
39- env :
40- RUSTFLAGS : " -D warnings"
41- steps :
42- - uses : actions/checkout@v4
43- - uses : dtolnay/rust-toolchain@stable
44- with :
45- toolchain : ${{ env.RUST_VERSION }}
46- - run : cargo check --all-features
47-
48- # Run tests.
49- test :
50- needs : check
51- name : Test Suite (linux)
52- runs-on : ubuntu-latest
53- env :
54- RUSTFLAGS : " -D warnings"
55- steps :
56- - uses : actions/checkout@v4
57- - uses : dtolnay/rust-toolchain@stable
58- with :
59- toolchain : ${{ env.RUST_VERSION }}
60- components : rustfmt
61- - run : cargo test --all-features
62-
63- # Checks code style.
64- clippy :
65- needs : check
66- name : Clippy
67- runs-on : ubuntu-latest
68- env :
69- RUSTFLAGS : " -D warnings"
70- steps :
71- - uses : actions/checkout@v4
72- - uses : dtolnay/rust-toolchain@stable
73- with :
74- toolchain : ${{ env.RUST_VERSION }}
75- components : clippy
76- - run : cargo clippy --all-features
77-
78- # Compute code coverage
79- codecov :
80- needs : test
81- name : Code coverage
82- runs-on : ubuntu-latest
83- steps :
84- - uses : actions/checkout@v4
85- - uses : dtolnay/rust-toolchain@stable
86- with :
87- toolchain : ${{ env.RUST_VERSION }}
88- # Install action using cargo-binstall, which is faster because we don't have to compile tarpaulin every time.
89- - uses : taiki-e/install-action@v2
90- with :
91- tool : cargo-tarpaulin
92- - run : cargo tarpaulin --verbose --lib --examples --all-features --out xml
93- - name : Upload to codecov.io
94- uses : codecov/codecov-action@v4
95- with :
96- token : ${{ secrets.CODECOV_TOKEN }}
97- - name : Archive code coverage results
98- uses : actions/upload-artifact@v4
99- with :
100- name : code-coverage-report
101- path : cobertura.xml
16+ validate :
17+ uses : sybila/github-workflows/.github/workflows/rust-build-and-check.yml@main
18+ with :
19+ rust-version : " 1.90.0"
20+ min-rust-version : " 1.88.0"
21+ secrets :
22+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
0 commit comments