-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (116 loc) · 3.77 KB
/
ci.yml
File metadata and controls
127 lines (116 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "32 4 * * 5"
jobs:
Rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: |
set -eu
for PKG in \
askama_web askama_web_derive \
test-actix-web-4 test-axum-0.7 test-axum-0.8 test-cot-0.3 test-cot-0.4 test-cot-0.5 test-cot-0.6 \
test-poem-3 test-rocket-0.5 test-trillium-0.2 test-warp-0.3 test-warp-0.4 test-axum-0.8-no-derive
do
cd "$PKG"
echo "Testing: $PKG"
cargo +nightly fmt -- --check
cd - > /dev/null
done
Docs:
strategy:
matrix:
package: [askama_web, askama_web_derive]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cd ${{ matrix.package }} && cargo doc --all-features --no-deps
env:
RUSTDOCFLAGS: -Z unstable-options --generate-link-to-definition --cfg=docsrs -D warnings
Audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: EmbarkStudios/cargo-deny-action@v2
with:
manifest-path: ./askama_web/Cargo.toml
Typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: crate-ci/typos@master
DevSkim:
name: DevSkim
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v6
- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@v1
- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: devskim-results.sarif
CargoSort:
name: Check order in Cargo.toml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: cargo install --git https://github.com/DevinR528/cargo-sort.git
- run: |
set -euo pipefail
cargo sort --grouped ./Cargo.toml
for PKG in \
askama_web askama_web_derive \
test-actix-web-4 test-axum-0.7 test-axum-0.8 test-cot-0.3 test-cot-0.4 test-cot-0.5 test-cot-0.6 \
test-poem-3 test-rocket-0.5 test-trillium-0.2 test-warp-0.3 test-warp-0.4 test-axum-0.8-no-derive
do
cd "$PKG"
cargo sort --grouped ./Cargo.toml
cd - > /dev/null
done
- run: |
git diff-index --patch --minimal --diff-algorithm=patience --shortstat --color=always --exit-code HEAD --
Package:
strategy:
matrix:
package: [
askama_web, askama_web_derive,
test-actix-web-4, test-axum-0.7, test-axum-0.8, test-cot-0.3, test-cot-0.4, test-cot-0.5, test-cot-0.6,
test-poem-3, test-rocket-0.5, test-trillium-0.2, test-warp-0.3, test-warp-0.4, test-axum-0.8-no-derive,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2
- run: cd ${{ matrix.package }} && cargo build --all-targets
- run: cd ${{ matrix.package }} && cargo nextest run --all-targets --no-fail-fast --no-tests=warn
- run: cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings
MSRV:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.88.0"
- run: cargo check --lib -p askama_web