2020 matrix :
2121 include :
2222 - os : ubuntu-latest
23- - os : macos-latest
2423 steps :
2524 - uses : actions/checkout@v6
2625 with : { submodules: recursive }
@@ -29,120 +28,3 @@ jobs:
2928 - uses : taiki-e/install-action@v2
3029 with : { tool: 'just,cargo-binstall' }
3130 - run : just ci-test
32-
33- test-nightly :
34- name : Nightly-specific tests
35- runs-on : ubuntu-latest
36- steps :
37- - uses : actions/checkout@v6
38- with : { submodules: recursive }
39- - if : github.event_name != 'release' && github.event_name != 'workflow_dispatch'
40- uses : Swatinem/rust-cache@v2
41- - uses : taiki-e/install-action@v2
42- with : { tool: 'just' }
43- - run : rustup install nightly --profile minimal
44- - run : just test-publish
45-
46- test-msrv :
47- name : Test MSRV
48- runs-on : ubuntu-latest
49- steps :
50- - uses : actions/checkout@v6
51- with : { submodules: recursive }
52- - if : github.event_name != 'release' && github.event_name != 'workflow_dispatch'
53- uses : Swatinem/rust-cache@v2
54- - uses : taiki-e/install-action@v2
55- with : { tool: 'just' }
56- - name : Read MSRV
57- id : msrv
58- run : echo "value=$(just get-msrv)" >> $GITHUB_OUTPUT
59- - name : Install MSRV Rust ${{ steps.msrv.outputs.value }}
60- uses : dtolnay/rust-toolchain@stable
61- with :
62- toolchain : ${{ steps.msrv.outputs.value }}
63- components : rustfmt
64- - run : just ci_mode=0 ci-test-msrv # Ignore warnings in MSRV
65- fuzz :
66- name : Fuzz
67- runs-on : ubuntu-latest
68-
69- env :
70- # The number of seconds to run the fuzz target.
71- FUZZ_TIME : 60
72-
73- strategy :
74- matrix :
75- include :
76- - fuzz_target : cpp_roundtrip
77- - fuzz_target : rust_compress_oracle
78- - fuzz_target : rust_decompress_oracle
79-
80- steps :
81- - uses : actions/checkout@v6
82- with : {persist-credentials: false, submodules: recursive}
83-
84- # Install the nightly Rust channel.
85- - run : rustup toolchain install nightly
86- - run : rustup default nightly
87-
88- # Install and cache `cargo-fuzz`.
89- - uses : taiki-e/install-action@v2
90- with :
91- tool : cargo-binstall
92- - run : cargo binstall -y cargo-fuzz@0.13.1 # Pinned to avoid breakage.
93-
94- # Build and then run the fuzz target.
95- # --target x86_64-unknown-linux-gnu is necessary to not default to musl, which is not supported by cargo-fuzz.
96- - run : cargo fuzz build --target x86_64-unknown-linux-gnu ${{ matrix.fuzz_target }}
97- - run : cargo fuzz run --target x86_64-unknown-linux-gnu ${{ matrix.fuzz_target }} -- -max_total_time=${{ env.FUZZ_TIME }}
98-
99- # Upload fuzzing artifacts on failure for post-mortem debugging.
100- - uses : actions/upload-artifact@v6
101- if : failure()
102- with :
103- name : fuzzing-artifacts-${{ matrix.fuzz_target }}-${{ github.sha }}
104- path : fuzz/artifacts
105-
106- coverage :
107- name : Code Coverage
108- if : github.event_name != 'release'
109- runs-on : ubuntu-latest
110- steps :
111- - uses : actions/checkout@v6
112- with : { submodules: recursive }
113- - uses : Swatinem/rust-cache@v2
114- - uses : taiki-e/install-action@v2
115- with : { tool: 'just,cargo-llvm-cov' }
116- - name : Generate code coverage
117- run : just ci-coverage
118- - name : Upload coverage to Codecov
119- uses : codecov/codecov-action@v5
120- with :
121- token : ${{ secrets.CODECOV_TOKEN }}
122- files : target/llvm-cov/codecov.info
123-
124- # This job checks if any of the previous jobs failed or were canceled.
125- # This approach also allows some jobs to be skipped if they are not needed.
126- ci-passed :
127- needs : [ test, test-nightly, test-msrv, fuzz ]
128- if : always()
129- runs-on : ubuntu-latest
130- steps :
131- - name : Result of the needed steps
132- run : echo "${{ toJSON(needs) }}"
133- - if : ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
134- run : exit 1
135-
136- release :
137- # Some dependencies of the `ci-passed` job might be skipped, but we still want to run if the `ci-passed` job succeeded.
138- if : always() && startsWith(github.ref, 'refs/tags/') && needs.ci-passed.result == 'success'
139- name : Publish to crates.io
140- needs : [ ci-passed ]
141- runs-on : ubuntu-latest
142- steps :
143- - uses : actions/checkout@v6
144- with : { submodules: recursive }
145- - name : Publish to crates.io
146- run : cargo publish
147- env :
148- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
0 commit comments