88 - cron : " 32 4 * * 5"
99
1010jobs :
11- # ###################################################################################################
12- # STEP 1: FASTEST
13- # ["Rustfmt", "Docs", "Audit", "Book", "Typos", "Jinja2-Assumptions", "DevSkim", "CargoSort"]
14- # ###################################################################################################
15-
1611 Rustfmt :
1712 runs-on : ubuntu-latest
1813 steps :
19- # No need to test `rinja_derive_standalone`. It has same the `src` folder as `rinja_derive`.
20- # No need to run the checks in parallel. They are fast enough.
21- # No need for caching. No code is compiled at all.
2214 - uses : actions/checkout@v4
2315 - uses : dtolnay/rust-toolchain@nightly
2416 with :
2517 components : rustfmt
26- - run : |
27- set -eu
28- for PKG in \
29- examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/salvo-app examples/warp-app fuzzing \
30- rinja rinja_derive rinja_derive_standalone rinja_parser \
31- testing testing-alloc testing-no-std testing-renamed
32- do
33- cd "$PKG"
34- echo "Testing: $PKG"
35- cargo +nightly fmt -- --check
36- cd - > /dev/null
37- done
18+ - run : cargo +nightly fmt --all -- --check
3819
3920 Docs :
40- strategy :
41- matrix :
42- package : [rinja, rinja_derive, rinja_parser]
4321 runs-on : ubuntu-latest
4422 steps :
4523 - uses : actions/checkout@v4
4624 - uses : dtolnay/rust-toolchain@nightly
4725 - uses : Swatinem/rust-cache@v2
48- - run : cd ${{ matrix.package }} && cargo doc --all-features --no-deps
26+ - run : cargo +nightly doc --all-features --no-deps --workspace
4927 env :
5028 RUSTDOCFLAGS : -Z unstable-options --generate-link-to-definition --cfg=docsrs -D warnings
5129
@@ -55,55 +33,12 @@ jobs:
5533 - uses : actions/checkout@v4
5634 - uses : EmbarkStudios/cargo-deny-action@v2
5735
58- Book :
59- runs-on : ubuntu-latest
60- steps :
61- - uses : actions/checkout@v4
62- - name : Generate "book/theme/index.hbs" as "skeleton" of the generated pages.
63- run : ./update-theme.py
64- working-directory : book
65- - name : Install mdbook
66- run : |
67- mkdir -p $HOME/bin
68- curl --location --silent --show-error --fail https://github.com/cargo-bins/cargo-quickinstall/releases/download/mdbook-0.4.40/mdbook-0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xzvvf - -C $HOME/bin
69- - name : Convert the book to HTML
70- run : $HOME/bin/mdbook build
71- working-directory : book
72-
7336 Typos :
7437 runs-on : ubuntu-latest
7538 steps :
7639 - uses : actions/checkout@v4
7740 - uses : crate-ci/typos@master
7841
79- Jinja2-Assumptions :
80- runs-on : ubuntu-latest
81- steps :
82- - uses : actions/checkout@v4
83- - uses : actions/setup-python@v5
84- with :
85- python-version : ' 3.13'
86- - uses : astral-sh/setup-uv@v5
87- - run : testing/jinja2-assumptions/test.sh
88-
89- DevSkim :
90- name : DevSkim
91- runs-on : ubuntu-latest
92- permissions :
93- actions : read
94- contents : read
95- security-events : write
96- steps :
97- - uses : actions/checkout@v4
98-
99- - name : Run DevSkim scanner
100- uses : microsoft/DevSkim-Action@v1
101-
102- - name : Upload DevSkim scan results to GitHub Security tab
103- uses : github/codeql-action/upload-sarif@v3
104- with :
105- sarif_file : devskim-results.sarif
106-
10742 CargoSort :
10843 name : Check order in Cargo.toml
10944 runs-on : ubuntu-latest
@@ -112,140 +47,4 @@ jobs:
11247 - uses : taiki-e/install-action@v2
11348 with :
11449 tool : cargo-sort
115- - run : |
116- cargo sort --check --check-format --grouped
117- set -eu
118- for PKG in \
119- examples/actix-web-app examples/axum-app examples/poem-app examples/rocket-app examples/salvo-app examples/warp-app fuzzing \
120- rinja rinja_derive rinja_derive_standalone rinja_parser \
121- testing testing-alloc testing-no-std testing-renamed
122- do
123- cd "$PKG"
124- cargo sort --check --check-format --grouped
125- cd - > /dev/null
126- done
127-
128- # ###################################################################################################
129- # STEP 2: INTERMEDIATE
130- # ["Test", "Package", "MSRV"]
131- # ###################################################################################################
132-
133- Test :
134- needs : ["Rustfmt", "Docs", "Audit", "Book", "Typos", "Jinja2-Assumptions", "DevSkim", "CargoSort"]
135- strategy :
136- matrix :
137- os : [ubuntu-latest, macos-latest, windows-latest]
138- rust : [stable, beta]
139- exclude :
140- - os : macos-latest
141- rust : beta
142- - os : windows-latest
143- rust : beta
144- runs-on : ${{ matrix.os }}
145- steps :
146- - uses : actions/checkout@v4
147- - uses : dtolnay/rust-toolchain@master
148- with :
149- toolchain : ${{ matrix.rust }}
150- - uses : taiki-e/install-action@v2
151- with :
152- tool : cargo-nextest
153- - uses : Swatinem/rust-cache@v2
154- - run : cargo build --all-targets --features full
155- - run : cargo nextest run --all-targets --no-tests=warn --features full
156-
157- Package :
158- needs : ["Rustfmt", "Docs", "Audit", "Book", "Typos", "Jinja2-Assumptions", "DevSkim", "CargoSort"]
159- strategy :
160- matrix :
161- package : [
162- examples/actix-web-app, examples/axum-app, examples/poem-app, examples/rocket-app, examples/salvo-app, examples/warp-app, fuzzing,
163- rinja, rinja_derive, rinja_derive_standalone, rinja_parser,
164- testing, testing-alloc, testing-no-std, testing-renamed,
165- ]
166- runs-on : ubuntu-latest
167- steps :
168- - uses : actions/checkout@v4
169- - uses : dtolnay/rust-toolchain@stable
170- with :
171- components : clippy
172- - uses : taiki-e/install-action@v2
173- with :
174- tool : cargo-nextest
175- - uses : Swatinem/rust-cache@v2
176- - run : cd ${{ matrix.package }} && cargo build --all-targets
177- - run : cd ${{ matrix.package }} && cargo nextest run --all-targets --no-fail-fast --no-tests=warn
178- - run : cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings
179-
180- MSRV :
181- needs : ["Rustfmt", "Docs", "Audit", "Book", "Typos", "Jinja2-Assumptions", "DevSkim", "CargoSort"]
182- runs-on : ubuntu-latest
183- steps :
184- - uses : actions/checkout@v4
185- - uses : dtolnay/rust-toolchain@master
186- with :
187- toolchain : " 1.81.0"
188- - run : cargo check --lib -p rinja --all-features
189-
190- # ###################################################################################################
191- # STEP 2: SLOW
192- # ["Fuzz", "Cluster-Fuzz"]
193- # ###################################################################################################
194-
195- Fuzz :
196- needs : ["Test", "Package", "MSRV"]
197- strategy :
198- matrix :
199- fuzz_target :
200- - all
201- - filters
202- - html
203- - parser
204- runs-on : ubuntu-latest
205- steps :
206- - uses : actions/checkout@v4
207- with :
208- submodules : recursive
209- - run : git submodule update --remote
210- - uses : dtolnay/rust-toolchain@master
211- with :
212- toolchain : nightly
213- components : rust-src
214- - run : curl --location --silent --show-error --fail https://github.com/cargo-bins/cargo-quickinstall/releases/download/cargo-fuzz-0.12.0/cargo-fuzz-0.12.0-x86_64-unknown-linux-gnu.tar.gz | tar -xzvvf - -C $HOME/.cargo/bin
215- - uses : Swatinem/rust-cache@v2
216- - run : cargo fuzz run ${{ matrix.fuzz_target }} --jobs 4 -- -max_total_time=240
217- working-directory : fuzzing
218- env :
219- RUSTFLAGS : ' -Ctarget-feature=-crt-static'
220-
221- Cluster-Fuzz :
222- needs : ["Test", "Package", "MSRV"]
223- runs-on : ubuntu-latest
224- permissions :
225- security-events : write
226- steps :
227- - name : Build Fuzzers
228- id : build
229- uses : google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
230- with :
231- oss-fuzz-project-name : rinja
232- language : rust
233- - name : Run Fuzzers
234- uses : google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
235- with :
236- oss-fuzz-project-name : rinja
237- language : rust
238- fuzz-seconds : 600
239- output-sarif : true
240- - name : Upload Crash
241- uses : actions/upload-artifact@v4
242- if : failure() && steps.build.outcome == 'success'
243- with :
244- name : artifacts
245- path : ./out/artifacts
246- - name : Upload Sarif
247- if : always() && steps.build.outcome == 'success'
248- uses : github/codeql-action/upload-sarif@v3
249- with :
250- sarif_file : cifuzz-sarif/results.sarif
251- checkout_path : cifuzz-sarif
50+ - run : cargo sort --workspace --grouped --check --check-format
0 commit comments