From 16a9a403fd59e8ddc6320e6f4ef6bcdd6af99d31 Mon Sep 17 00:00:00 2001 From: Ruben Serrano Izquierdo Date: Sun, 3 Nov 2024 16:52:54 +0100 Subject: [PATCH 1/5] Add manual trigger for check workflow --- .github/workflows/check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b984fce..30740dc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: {} concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }} cancel-in-progress: true From 9cd97e1162e01abb1181e89deec3739b17416981 Mon Sep 17 00:00:00 2001 From: Ruben Serrano Izquierdo Date: Sun, 3 Nov 2024 17:03:03 +0100 Subject: [PATCH 2/5] Trigger check workflow in all PR --- .github/workflows/check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 30740dc..52962a0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,8 +3,7 @@ permissions: on: push: branches: [master] - pull_request: - branches: [master] + pull_request: {} workflow_dispatch: {} concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }} From bed8162f65bb8b429aae40d83c5d9489f9179e36 Mon Sep 17 00:00:00 2001 From: Ruben Serrano Izquierdo Date: Tue, 17 Dec 2024 14:41:17 +0100 Subject: [PATCH 3/5] Add semver check step and cache to actions --- .github/workflows/check.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 52962a0..c7f3979 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,13 +1,16 @@ permissions: contents: read + on: push: branches: [master] pull_request: {} workflow_dispatch: {} + concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }} cancel-in-progress: true + name: check jobs: check: @@ -19,24 +22,34 @@ jobs: compiler: [msvc, gnu] feature: [vendored, static] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + id: toolchain with: targets: x86_64-pc-windows-${{ matrix.compiler }} + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ steps.toolchain.outputs.cachekey }} + - name: Semver checks + uses: obi1kenobi/cargo-semver-checks-action@v2 - name: cargo check run: cargo check --target x86_64-pc-windows-${{ matrix.compiler }} --features ${{ matrix.feature }} doc: runs-on: windows-latest name: docs / stable steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + id: toolchain + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ steps.toolchain.outputs.cachekey }}-docs - name: cargo doc run: cargo doc --no-deps --all-features env: @@ -50,12 +63,16 @@ jobs: matrix: msrv: [1.64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@master + id: toolchain with: toolchain: ${{ matrix.msrv }} + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ steps.toolchain.outputs.cachekey }}-msvr - name: cargo +${{ matrix.msrv }} check run: cargo check --all-features From 24917227a5a0a9e59675cdc396d882dce7d40b57 Mon Sep 17 00:00:00 2001 From: Ruben Serrano Izquierdo Date: Tue, 17 Dec 2024 14:46:16 +0100 Subject: [PATCH 4/5] Improve action caching --- .github/workflows/check.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c7f3979..8441f95 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -32,9 +32,11 @@ jobs: targets: x86_64-pc-windows-${{ matrix.compiler }} - uses: Swatinem/rust-cache@v2 with: - key: ${{ steps.toolchain.outputs.cachekey }} + key: ${{ steps.toolchain.outputs.cachekey }}-${{ matrix.compiler }} - name: Semver checks uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + shared-key: ${{ steps.toolchain.outputs.cachekey }}-${{ matrix.compiler }} - name: cargo check run: cargo check --target x86_64-pc-windows-${{ matrix.compiler }} --features ${{ matrix.feature }} doc: @@ -49,7 +51,7 @@ jobs: id: toolchain - uses: Swatinem/rust-cache@v2 with: - key: ${{ steps.toolchain.outputs.cachekey }}-docs + key: ${{ steps.toolchain.outputs.cachekey }} - name: cargo doc run: cargo doc --no-deps --all-features env: @@ -73,6 +75,6 @@ jobs: toolchain: ${{ matrix.msrv }} - uses: Swatinem/rust-cache@v2 with: - key: ${{ steps.toolchain.outputs.cachekey }}-msvr + key: ${{ steps.toolchain.outputs.cachekey }} - name: cargo +${{ matrix.msrv }} check run: cargo check --all-features From 823e99257f61d083bf9921e1512a6b149b620233 Mon Sep 17 00:00:00 2001 From: Ruben Serrano Izquierdo Date: Tue, 17 Dec 2024 15:00:00 +0100 Subject: [PATCH 5/5] Move semver after checking --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8441f95..a68f52f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -33,12 +33,12 @@ jobs: - uses: Swatinem/rust-cache@v2 with: key: ${{ steps.toolchain.outputs.cachekey }}-${{ matrix.compiler }} + - name: cargo check + run: cargo check --target x86_64-pc-windows-${{ matrix.compiler }} --features ${{ matrix.feature }} - name: Semver checks uses: obi1kenobi/cargo-semver-checks-action@v2 with: shared-key: ${{ steps.toolchain.outputs.cachekey }}-${{ matrix.compiler }} - - name: cargo check - run: cargo check --target x86_64-pc-windows-${{ matrix.compiler }} --features ${{ matrix.feature }} doc: runs-on: windows-latest name: docs / stable