-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 2.22 KB
/
Copy pathci.yml
File metadata and controls
80 lines (71 loc) · 2.22 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
# CI gates for ES-Runtime (SPEC.md §5). All jobs are required.
#
# The `v8` crate downloads a prebuilt static library at build time, so the
# clippy/test/msrv jobs need network and benefit from the Rust cache. The
# toolchain is pinned by rust-toolchain.toml (1.95.0); the MSRV job exists to
# assert the declared `rust-version` actually builds.
name: CI
on:
push:
branches: [main]
pull_request:
# One in-flight run per ref; cancel superseded runs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt --all --check
clippy:
name: clippy -D warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
# Build first so the `v8` crate fetches its prebuilt static lib. Clippy
# runs in check mode, which doesn't trigger that download on a cold cache;
# deps build with normal rustc (only workspace crates use clippy-driver),
# so clippy then reuses the v8 artifact.
- run: cargo build --workspace --all-features
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --all-features
msrv:
name: msrv build (1.95)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
# Build with the declared MSRV explicitly, overriding rust-toolchain.toml.
- run: rustup toolchain install 1.95.0 --profile minimal
- run: cargo +1.95.0 build --workspace --all-features
deny:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-deny
- run: cargo deny check
audit:
name: cargo-audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-audit
- run: cargo audit