diff --git a/.github/workflows/rust-check.yml b/.github/workflows/rust-check.yml index 73c2e2d..c347b13 100644 --- a/.github/workflows/rust-check.yml +++ b/.github/workflows/rust-check.yml @@ -10,11 +10,15 @@ env: CARGO_TERM_COLOR: always jobs: - cargo-test: + 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 diff --git a/judge-core/tests/judge_test.rs b/judge-core/tests/judge_test.rs index e07b07d..4604763 100644 --- a/judge-core/tests/judge_test.rs +++ b/judge-core/tests/judge_test.rs @@ -69,7 +69,7 @@ fn test_run_judge() { assert_eq!(result.verdict, JudgeVerdict::Accepted); } else { log::debug!("{:?}", result); - assert!(false) + unreachable!() } } @@ -146,7 +146,7 @@ fn test_run_interact() { } Err(e) => { log::error!("meet error: {:?}", e); - assert!(false); + unreachable!() } } }