-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (54 loc) · 1.61 KB
/
generic.yml
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
name: "generic rust checks"
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
# If new code is pushed to a PR branch, then cancel in progress workflows for
# that PR. Ensures that we don't waste CI time, and returns results quicker.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
# Not needed in CI, should make things a bit faster
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
# Remove unnecessary WASM build artifacts
WASM_BUILD_CLEAN_TARGET: 1
# stripping symbols and optimizing for binary size
RUSTFLAGS: -C strip=symbols -C opt-level=s
# Enable sscache
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "50GB"
jobs:
clippy-fmt-test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Run sccache
uses: mozilla-actions/[email protected]
- name: install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- name: Check format
run: cargo fmt --all -- --check
- name: Run tests
run: cargo test run --release
- name: Check clippy
run: cargo clippy --release --locked --all-targets -- -D warnings
- name: Check Documentation
run: cargo doc --release --locked --all --no-deps
env:
RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links"