From 573ceb4e89aaec1f69a9c1ffdf8bad03bd9c41e6 Mon Sep 17 00:00:00 2001 From: Mathieu Soysal <43273304+MathieuSoysal@users.noreply.github.com> Date: Sat, 17 Feb 2024 07:33:13 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Update=20integration-test.yml=20?= =?UTF-8?q?workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the integration-test.yml workflow file. It includes changes such as installing Rust nightly, caching Cargo, checking formatting, linting dependencies, and running tests. --- .github/workflows/integration-test.yml | 118 ++++++++++++++++++------- 1 file changed, 88 insertions(+), 30 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index a88562a..920ba7e 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -13,31 +13,49 @@ env: CARGO_TERM_COLOR: always jobs: - + cargo_fmt: name: Cargo Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Add fmt - run: rustup component add rustfmt - - name: Run fmt - run: cargo fmt -- --check + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@master + id: rust-toolchain + with: + toolchain: nightly + components: rustfmt + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ steps.rust-toolchain.outputs.cachekey }}+${{ runner.os }} + - name: Check formatting + run: cargo make lint-format + - name: Check documentation + run: cargo make lint-docs + - name: Check typos + uses: crate-ci/typos@master + - name: Lint dependencies + uses: EmbarkStudios/cargo-deny-action@v1 cargo_clippy: name: Cargo Clippy + needs: [cargo_fmt] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@master + id: rust-toolchain + with: + toolchain: nightly + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ steps.rust-toolchain.outputs.cachekey }}+${{ runner.os }} - uses: rui314/setup-mold@v1 with: mold-version: ${{ env.MOLD_VERSION }} @@ -47,38 +65,71 @@ jobs: run: cargo clippy cargo_test: + name: Cargo Test + needs: [cargo_fmt] strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - name: Cargo Test runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@master + id: rust-toolchain + with: + toolchain: nightly + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ steps.rust-toolchain.outputs.cachekey }}+${{ runner.os }} - uses: rui314/setup-mold@v1 with: mold-version: ${{ env.MOLD_VERSION }} - name: cargo test run: cargo test - cargo-mutants: # https://mutants.rs + check: + name: Cargo Check + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@master + id: rust-toolchain + with: + toolchain: nightly + - name: Install cargo-make + uses: taiki-e/install-action@cargo-make + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ steps.rust-toolchain.outputs.cachekey }}+${{ runner.os }} + - name: Run cargo make check + run: cargo make check + env: + RUST_BACKTRACE: full + + cargo_mutants: # https://mutants.rs name: Cargo Mutants needs: [cargo_test, cargo_clippy, cargo_fmt] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@master + id: rust-toolchain with: toolchain: nightly + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ steps.rust-toolchain.outputs.cachekey }}+${{ runner.os }} - uses: taiki-e/install-action@v2 name: Install cargo-mutants using install-action with: @@ -92,15 +143,22 @@ jobs: name: mutants-out path: mutants.out - coverage: + cargo_coverage: + name: Cargo Coverage + needs: [cargo_test] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@master + id: rust-toolchain with: toolchain: nightly components: llvm-tools + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ steps.rust-toolchain.outputs.cachekey }}+${{ runner.os }} - name: cargo install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: cargo llvm-cov