diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c4b5259b1..942a02212 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,7 +11,7 @@ jobs: all: runs-on: ubuntu-20.04 env: - CARGO_ARGS: --release + RUSTFLAGS: -D warnings steps: - name: Code checkout uses: actions/checkout@v2 @@ -21,39 +21,24 @@ jobs: with: toolchain: stable + - name: Download cargo cache + uses: Swatinem/rust-cache@v1 + # A SSH private key is required as some dependencies are from private repos - uses: webfactory/ssh-agent@v0.5.2 with: ssh-private-key: ${{ secrets.CONCRETE_COMPILER_CI_SSH_PRIVATE }} - - name: cargo check - uses: actions-rs/cargo@v1 - with: - command: check - args: ${{ env.CARGO_ARGS }} + - name: Formatting + run: cargo fmt --check - - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + # For some reason doing the build explicitely before make it available for both clippy and test + # But clippy and test alone do not share the build + - name: Build + run: cargo build --all-targets - - name: cargo build - uses: actions-rs/cargo@v1 - env: - RUSTFLAGS: -D warnings - with: - command: build - args: ${{ env.CARGO_ARGS }} --lib --examples --tests + - name: Lint + run: cargo clippy --all-targets - - name: cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: ${{ env.CARGO_ARGS }} -- -D warnings - - - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: ${{ env.CARGO_ARGS }} --no-fail-fast --all-targets + - name: Tests + run: cargo test --no-fail-fast --all-targets diff --git a/v0-parameters/src/main.rs b/v0-parameters/src/main.rs index 73e59d6ff..6f3da1acf 100644 --- a/v0-parameters/src/main.rs +++ b/v0-parameters/src/main.rs @@ -158,6 +158,6 @@ mod tests { let expected_output = std::fs::read_to_string(REF_FILE).expect("Can't read reference file"); - text_diff::assert_diff(&expected_output, &actual_output, CMP_LINES, EXACT_EQUALITY); + text_diff::assert_diff(&expected_output, actual_output, CMP_LINES, EXACT_EQUALITY); } }