From 7c06c83a258ed5435429e180e58a90b276da9343 Mon Sep 17 00:00:00 2001 From: BlackDex Date: Fri, 24 Jan 2025 12:17:39 +0100 Subject: [PATCH] Fix and adjust build workflow The build workflow had an issue with some `if` checks. For one they had two `$` signs, and it is not recommended to use `always()` since canceling a workflow does not cancel those calls. Using `!cancelled()` is the preferred way. Signed-off-by: BlackDex --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74f9c44c..0202e681 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,37 +120,37 @@ jobs: # First test all features together, afterwards test them separately. - name: "test features: sqlite,mysql,postgresql,enable_mimalloc,query_logger" id: test_sqlite_mysql_postgresql_mimalloc_logger - if: $${{ always() }} + if: ${{ !cancelled() }} run: | cargo test --features sqlite,mysql,postgresql,enable_mimalloc,query_logger - name: "test features: sqlite,mysql,postgresql,enable_mimalloc" id: test_sqlite_mysql_postgresql_mimalloc - if: $${{ always() }} + if: ${{ !cancelled() }} run: | cargo test --features sqlite,mysql,postgresql,enable_mimalloc - name: "test features: sqlite,mysql,postgresql" id: test_sqlite_mysql_postgresql - if: $${{ always() }} + if: ${{ !cancelled() }} run: | cargo test --features sqlite,mysql,postgresql - name: "test features: sqlite" id: test_sqlite - if: $${{ always() }} + if: ${{ !cancelled() }} run: | cargo test --features sqlite - name: "test features: mysql" id: test_mysql - if: $${{ always() }} + if: ${{ !cancelled() }} run: | cargo test --features mysql - name: "test features: postgresql" id: test_postgresql - if: $${{ always() }} + if: ${{ !cancelled() }} run: | cargo test --features postgresql # End Run cargo tests @@ -159,7 +159,7 @@ jobs: # Run cargo clippy, and fail on warnings - name: "clippy features: sqlite,mysql,postgresql,enable_mimalloc" id: clippy - if: ${{ always() && matrix.channel == 'rust-toolchain' }} + if: ${{ !cancelled() && matrix.channel == 'rust-toolchain' }} run: | cargo clippy --features sqlite,mysql,postgresql,enable_mimalloc -- -D warnings # End Run cargo clippy @@ -168,7 +168,7 @@ jobs: # Run cargo fmt (Only run on rust-toolchain defined version) - name: "check formatting" id: formatting - if: ${{ always() && matrix.channel == 'rust-toolchain' }} + if: ${{ !cancelled() && matrix.channel == 'rust-toolchain' }} run: | cargo fmt --all -- --check # End Run cargo fmt