-
-
Notifications
You must be signed in to change notification settings - Fork 166
102 lines (85 loc) · 2.25 KB
/
CI.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
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
name: CI
on:
- push
- pull_request
env:
CI: 1
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: "always"
DIFF: 0
# For faster CI
RUST_LOG: "off"
# https://github.com/swc-project/swc/pull/3742
RUST_MIN_STACK: 4194304
CARGO_PROFILE_RELEASE_LTO: false
jobs:
check-spelling:
name: Check spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn
- run: npx cspell --no-progress '**/*'
cargo-fmt:
name: Cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We explicitly do this to cache properly.
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt
- run: cargo fmt --all -- --check
cargo-clippy:
name: Cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We explicitly do this to cache properly.
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: clippy
- run: cargo clippy --all --all-targets -- -D warnings
cargo-test:
name: Cargo test
runs-on: ubuntu-latest
steps:
- name: Handle line endings
shell: bash
if: runner.os == 'Windows'
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- uses: actions/checkout@v3
with:
submodules: true
# Source map format
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "yarn"
# We explicitly do this to cache properly.
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-wasi
- name: Install node dependencies
shell: bash
run: |
yarn
- name: Configure path (windows)
shell: bash
if: runner.os == 'Windows'
run: |
echo $(yarn global bin) >> $GITHUB_PATH
- name: Cache rust artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: cargo-test
cache-on-failure: true
- name: Run cargo test
run: |
RUST_MIN_STACK=8388608 cargo test --all --features tracing/max_level_off --features no-threading