forked from web-infra-dev/rspack
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 1.86 KB
/
check-rs.yaml
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
name: check-rs
on:
push:
branches:
- main
tags-ignore:
- "**"
pull_request:
paths: # Only run when changes are made to rust code or root Cargo
- "crates/**"
- "examples/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "rustfmt.toml"
- "clippy.toml"
# cancel previous job runs for the same workflow + pr
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
lint-format-test:
name: lint, format, spell check, test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install toolchain
run: rustup show
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: check
- name: Spell Check
uses: crate-ci/typos@master
with:
files: .
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run Cargo Check
run: cargo check --workspace --all-targets --release --locked
- name: Run Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- -D warnings
- name: Check Dependencies
run: node ./scripts/check_rust_dependency.js
- name: Run test
# We need to install sass first to enable sass-loader
run: |
node -e "console.log(process.arch)"
npm install -g [email protected]
pnpm install
cargo test --workspace -- --nocapture --test-threads=1