From aac49ecab441b0e6c2f41e82b3e5ae92dfc9a19b Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Tue, 2 Nov 2021 20:49:22 +0100 Subject: [PATCH 1/2] CI: Run only on `main/master` pushes --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76ebd037ba..647c21b94f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,9 @@ name: CI on: push: + branches: + - master + - main pull_request: env: From 6a85c1c4c227196f4292f87676bd8d2f762fc84a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Tue, 2 Nov 2021 21:01:37 +0100 Subject: [PATCH 2/2] CI: Split up into multiple jobs --- .github/workflows/ci.yml | 56 +++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 647c21b94f..1c13bc1ee1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,32 +12,42 @@ env: MSRV: 1.46.0 jobs: - backend: - name: Backend - runs-on: ubuntu-18.04 - - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" - + check: + name: Check + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: rustup override set ${{env.MSRV}} + - uses: Swatinem/rust-cache@v1.3.0 + - run: cargo check --workspace --all-targets + env: + RUSTFLAGS: "-D warnings" - - name: Install Rust v${{ env.MSRV }} - run: | - rustup default ${{ env.MSRV }} - - - name: Install lint tools - run: | - rustup component add rustfmt - rustup component add clippy - + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: rustup override set ${{env.MSRV}} - uses: Swatinem/rust-cache@v1.3.0 + - run: cargo test --workspace - - name: Lint - run: | - cargo fmt -- --check - cargo clippy --all-targets --all-features --all + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: rustup override set ${{env.MSRV}} + - run: rustup component add rustfmt + - uses: Swatinem/rust-cache@v1.3.0 + - run: cargo fmt --all -- --check - - name: Test - run: cargo test + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: rustup override set ${{env.MSRV}} + - run: rustup component add clippy + - uses: Swatinem/rust-cache@v1.3.0 + - run: cargo clippy --workspace -- --deny warnings