forked from GuillaumeGomez/rustc-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.65 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
on:
push:
branches: [master]
pull_request:
name: CI
# If a new push on the PR is done, cancel the build
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup show active-toolchain
- run: cargo fmt -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sed -i "s/rustfmt/clippy/" rust-toolchain
- run: rustup show active-toolchain
- run: cargo clippy --all-targets -- -D warnings
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup show active-toolchain
- run: cargo check
- run: cargo run --example ast -- asset/example_file.rs
- run: cargo run --example hir -- asset/example_file.rs
- run: cargo build --example lint
- run: (cargo run --example lint -- asset/example_file.rs && exit 1) || exit 0
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: |
git clone "https://github.com/GuillaumeGomez/rustc-tools-example"
cd rustc-tools-example
cd cargo-tools-inner
: # We make it target the current `rustc-tools`
sed -ie 's|rustc\-tools = "[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+"|rustc\-tools = \{ path = "../../" \}|' Cargo.toml
cargo install --path .
cd ../cargo-tools
cargo install --path .
cd ../../tests
: # We ensure that the lints are run.
cargo tools 2>&1 | grep 'functions with odd number of lines should not exist'