From 4b7a246add089c83cb7144132dc311fe50eb326d Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Sep 2023 12:30:59 +0200 Subject: [PATCH 1/6] workflows/main.yml: parallellize workflow --- .github/workflows/main.yml | 51 +++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cd2599..27fd67a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,12 +1,21 @@ name: CI - on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - name: Build + run: cargo build --verbose + check: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -19,8 +28,22 @@ jobs: run: cargo fmt -- --check - name: Check clippy run: cargo clippy -- --deny warnings - - name: Build - run: cargo build --verbose + + test: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + include: + - os: macos-latest + - os: ubuntu-latest + - os: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true - uses: actions-rs/cargo@v1 with: command: test @@ -34,7 +57,27 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ${{ steps.coverage.outputs.report }} + + benchmarks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true - name: Run benchmarks run: cargo bench --verbose + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true - name: Build docs run: cargo doc --verbose From 0df4ae9296f290193a2ab0592a5606f058701e04 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Sep 2023 12:30:59 +0200 Subject: [PATCH 2/6] workflows/main.yml: update external actions - `actions/checkout@v2` -> `actions/checkout@v3` - `actions-rs/toolchain@v1` -> `dtolnay/rust-toolchain@nightly` --- .github/workflows/main.yml | 42 ++++++++++++-------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27fd67a..e852699 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,25 +5,18 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly - name: Build run: cargo build --verbose check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt, clippy + components: clippy, rustfmt - name: Check code format run: cargo fmt -- --check - name: Check clippy @@ -38,15 +31,10 @@ jobs: - os: ubuntu-latest - os: windows-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/cargo@v1 - with: - command: test + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - name: Run tests + run: cargo test env: CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort' @@ -61,7 +49,7 @@ jobs: benchmarks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -73,11 +61,7 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly - name: Build docs - run: cargo doc --verbose + run: cargo doc --verbose \ No newline at end of file From 511fd2926ec1f52e20a98936ebde5891f6dd12bb Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Sep 2023 12:31:00 +0200 Subject: [PATCH 3/6] workflows/main.yml: remove benchmark step We don't have any benchmarks at the moment, so this step is pointless --- .github/workflows/main.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e852699..525949a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,18 +46,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ${{ steps.coverage.outputs.report }} - benchmarks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - name: Run benchmarks - run: cargo bench --verbose - docs: runs-on: ubuntu-latest steps: From 0323a1ce0a8b93d222939f50f05ba8cfc4796322 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Sep 2023 13:48:57 +0200 Subject: [PATCH 4/6] workflows/main.yml: only run coveralls push on PRs --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 525949a..f556ccc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ${{ steps.coverage.outputs.report }} + if: github.event_name == 'pull_request' docs: runs-on: ubuntu-latest From ff0d34af42ed65ac68d149ed31e1841ca1279b83 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Sep 2023 13:51:10 +0200 Subject: [PATCH 5/6] workflows/main.yml: add dependency cache --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f556ccc..e27f7eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --verbose @@ -17,6 +18,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly with: components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 - name: Check code format run: cargo fmt -- --check - name: Check clippy @@ -33,6 +35,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 - name: Run tests run: cargo test env: @@ -52,5 +55,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 - name: Build docs run: cargo doc --verbose \ No newline at end of file From db56238ace4e62b34dfc06425ad573a11d0a82b1 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 6 Sep 2023 10:11:39 +0200 Subject: [PATCH 6/6] workflows/main.yml: enable all package features --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e27f7eb..cbf2929 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly - uses: Swatinem/rust-cache@v2 - name: Build - run: cargo build --verbose + run: cargo build --all-features --verbose check: runs-on: ubuntu-latest @@ -22,7 +22,7 @@ jobs: - name: Check code format run: cargo fmt -- --check - name: Check clippy - run: cargo clippy -- --deny warnings + run: cargo clippy --all-features -- --deny warnings test: runs-on: '${{ matrix.os }}' @@ -37,7 +37,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly - uses: Swatinem/rust-cache@v2 - name: Run tests - run: cargo test + run: cargo test --all-features env: CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort' @@ -57,4 +57,4 @@ jobs: - uses: dtolnay/rust-toolchain@nightly - uses: Swatinem/rust-cache@v2 - name: Build docs - run: cargo doc --verbose \ No newline at end of file + run: cargo doc --verbose