-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (31 loc) · 1.09 KB
/
rust-check.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
name: Rust Check
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Check format
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libseccomp-dev protobuf-compiler gcc-11 g++-11
- name: Setup gcc/g++ 11
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
- name: Check ENV
run: echo $(rustup --version && g++ -v)
- name: Build test dist
run: cd judge-core/tests/data/built-in-programs && ./build.sh && cd ../../../../
- name: Run tests
# Currently use --test-threads=1 to avoid log mess
# Should only be used in judge-core later
run: RUST_LOG=info cargo test -- --nocapture --test-threads=1