From aeaefa4899709ae4742fee30d24f282766bb3417 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 14 Sep 2023 12:02:32 -0600 Subject: [PATCH 1/6] Fold MSRV into a single matrix and test nightly --- .github/workflows/msrv.yml | 42 ------------------------------------- .github/workflows/tests.yml | 4 ++++ 2 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/msrv.yml diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml deleted file mode 100644 index 2a02f35c..00000000 --- a/.github/workflows/msrv.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: MSRV - -permissions: - contents: read - -on: - push: - branches: - - main - pull_request: - -# see https://matklad.github.io/2021/09/04/fast-rust-builds.html -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - CARGO_NET_RETRY: 10 - CI: 1 - RUST_BACKTRACE: short - RUSTFLAGS: "-W rust-2021-compatibility" - RUSTUP_MAX_RETRIES: 10 - CARGO_MUTANTS_MINIMUM_TEST_TIMEOUT: 60 - -jobs: - test: - strategy: - matrix: - toolchain: ["1.65"] - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: Swatinem/rust-cache@v2 - - name: Toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.toolchain }} - - name: Show Cargo and rustc version - run: | - cargo +${{ matrix.toolchain }} --version - rustc +${{ matrix.toolchain }} --version - - name: Test - run: cargo +${{ matrix.toolchain }} test --workspace diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6629fb35..71d44cfb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,11 +25,15 @@ jobs: strategy: matrix: os: [macOS-latest, ubuntu-latest, windows-latest] + version: [stable, nightly, "1.70"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.version }} - name: Show Cargo and rustc version run: | cargo --version From f50d78ede0bade03f37aa018c99b02fdf688f7ae Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 14 Sep 2023 12:02:55 -0600 Subject: [PATCH 2/6] Run tests on every push --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 71d44cfb..3e847c40 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,11 +3,7 @@ name: Tests permissions: contents: read -on: - push: - branches: - - main - pull_request: +on: push # see https://matklad.github.io/2021/09/04/fast-rust-builds.html env: From 8c754829162681a4256c7838fca3e543e4505985 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 14 Sep 2023 12:04:30 -0600 Subject: [PATCH 3/6] Install rustfmt --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e847c40..a2b1d138 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,6 +30,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.version }} + components: rustfmt - name: Show Cargo and rustc version run: | cargo --version From 8d8648f8be6da976adfad70828b436537c5a925b Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 14 Sep 2023 12:10:02 -0600 Subject: [PATCH 4/6] Run cargo-mutants only after tests pass --- .github/workflows/mutate-self.yaml | 35 ------------------------------ .github/workflows/tests.yml | 17 +++++++++++++++ 2 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/mutate-self.yaml diff --git a/.github/workflows/mutate-self.yaml b/.github/workflows/mutate-self.yaml deleted file mode 100644 index 3b7a71c0..00000000 --- a/.github/workflows/mutate-self.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# Run cargo mutants on itself -name: cargo-mutants - -on: - pull_request: - branches: - - main - push: - branches: - - main - - ci-* - -env: - # Some runners, especially on Windows, have uneven performance; allow lots - # of time before concluding something hung. - CARGO_MUTANTS_MINIMUM_TEST_TIMEOUT: 240 - -jobs: - cargo-mutants: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: Swatinem/rust-cache@v2 - - name: Install - run: | - cargo install --path . - - name: Mutants - run: | - cargo mutants --no-shuffle --exclude console.rs -j 2 - - name: Archive mutants.out - uses: actions/upload-artifact@v3 - if: always() - with: - name: mutants.out - path: mutants.out diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2b1d138..88930706 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,3 +44,20 @@ jobs: run: cargo test --workspace - name: Install run: cargo install --path . + + cargo-mutants: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - run: cargo install --path . + - name: Mutants + run: | + cargo mutants --no-shuffle --exclude console.rs -j 2 + - name: Archive mutants.out + uses: actions/upload-artifact@v3 + if: always() + with: + name: mutants.out + path: mutants.out From 5a14701482f27d12bf9283d82b6093af434e416d Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 14 Sep 2023 13:43:20 -0600 Subject: [PATCH 5/6] Don't need to test install in each test It will be covered enough in the self mutanst test. --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 88930706..1de1e564 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,8 +42,6 @@ jobs: run: cargo build --all-targets - name: Test run: cargo test --workspace - - name: Install - run: cargo install --path . cargo-mutants: runs-on: ubuntu-latest From 3e596e445d5b14e82eec0f3aef2f567773d7da94 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 14 Sep 2023 13:45:07 -0600 Subject: [PATCH 6/6] Use rust-toolchain for mutants too --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1de1e564..b84cefc5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: needs: build steps: - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: beta - uses: Swatinem/rust-cache@v2 - run: cargo install --path . - name: Mutants