From d5dcd0ab9491d9baebff506f2702fa0bb5c4b169 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 8 Feb 2021 23:15:47 +0800 Subject: [PATCH 1/4] Enable CI for pull requests --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a89d65..07fb71e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Test on: push: + pull_request: schedule: - cron: '21 3 ? * 6' From e4e0f5820d31cd4c5d997bbee86982ea2eef058a Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 8 Feb 2021 16:25:44 +0100 Subject: [PATCH 2/4] only run CI for pushes to master --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07fb71e..9f0df96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Test on: push: + branches: master pull_request: schedule: - cron: '21 3 ? * 6' From 5d616da776fd0aae8dd497ac77f5e5bc8045db97 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 8 Feb 2021 16:30:32 +0100 Subject: [PATCH 3/4] fix ci toolchain version --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f0df96..2e9a7c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,14 +23,14 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: ${{ matrix.rust }} # Only install the components on stable (might not be available on nightly). components: rustfmt, clippy - if: matrix.rust != 'stable' uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: ${{ matrix.rust }} # Just check compilations on platforms other than stable. - run: | cargo check --all --manifest-path ./Cargo.toml From 6cc7d5dcf0d7c0572e2a1ef42a3b728fba093dbc Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Mon, 8 Feb 2021 16:36:34 +0100 Subject: [PATCH 4/4] don't run `cargo check` on stable --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e9a7c3..cefb817 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,10 @@ jobs: profile: minimal toolchain: ${{ matrix.rust }} # Just check compilations on platforms other than stable. - - run: | + # Note that we have to explicitly exclude stable, because `cargo clippy` + # after `cargo check` does not work properly: https://github.com/rust-lang/rust-clippy/issues/4612 + - if: matrix.rust == 'stable' + run: | cargo check --all --manifest-path ./Cargo.toml # Only run the stable versions of Clippy and rustfmt. - if: matrix.rust == 'stable'