-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 2.01 KB
/
test.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
name: 'Test'
on:
pull_request:
branches: [ "master" ]
push:
branches: [ "master" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
code-quality:
name: "Code Quality"
runs-on: [self-hosted, linux, normal]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
# Check out pull request HEAD instead of merge commit.
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: "Set up nightly Rust" # https://github.com/rust-lang/rustup/issues/3409
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-11-29 # Hardcoded version, same as is in the build.rs
- name: 'Build smir_pretty' # rustfmt documentation claims it is unstable on code that doesn't build
run: |
cargo build -vv
- name: "Check `cargo clippy`"
run: |
rustup component add clippy
cargo clippy -- -Dwarnings
- name: "Check `cargo fmt`"
run: |
rustup component add rustfmt
cargo fmt --check
integration-tests:
needs: code-quality
name: "Integration tests"
runs-on: [self-hosted, linux, normal]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
# Check out pull request HEAD instead of merge commit.
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: "Set up nightly Rust" # https://github.com/rust-lang/rustup/issues/3409
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-11-29 # Hardcoded version, same as is in the build.rs
- name: 'Build smir_pretty'
run: | # Warning check should be redundant since code-quality runs first
RUSTFLAGS='--deny warnings' cargo build -vv
- name: 'Run smir integration tests'
run: |
make integration-test