From d992333f2e68883a6f5281068f771b47e7ab481f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 30 May 2025 15:59:28 +0000 Subject: [PATCH] ci: Add some sanity conditions for skips; formatting Signed-off-by: Jason Volk --- .github/workflows/bake.yml | 9 +++++++-- .github/workflows/lint.yml | 1 + .github/workflows/package.yml | 1 - .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++---- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index e90def25..663661ff 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -5,7 +5,6 @@ on: inputs: bake_targets: type: string - default: '["default"]' description: Bake Matrix cargo_profiles: type: string @@ -58,7 +57,13 @@ on: jobs: bake: - if: ${{ !failure() && !cancelled() && fromJSON(inputs.machines)[0] != null }} + if: > + ${{ + !failure() && !cancelled() + && fromJSON(inputs.machines)[0] != null + && fromJSON(inputs.bake_targets)[0] != null + }} + name: > ${{matrix.bake_target}} ${{matrix.cargo_profile}} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index add07aff..83c954f5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -133,6 +133,7 @@ jobs: if: > ${{ !failure() && !cancelled() + && inputs.cargo.profiles }} name: Clippy uses: ./.github/workflows/bake.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 433aecce..7717ab0d 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -5,7 +5,6 @@ on: inputs: cargo_profiles: type: string - default: '["release"]' description: Cargo profiles feat_sets: type: string diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a40077a4..818525cd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,7 +5,6 @@ on: inputs: cargo_profiles: type: string - default: '["release"]' description: Cargo profiles feat_sets: type: string @@ -48,6 +47,7 @@ jobs: if: > ${{ !failure() && !cancelled() + && inputs.machines && inputs.docker_repo && github.ref == 'refs/heads/main' }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03e90086..eea415e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,12 @@ on: jobs: unit: - if: ${{contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])}} + if: > + ${{ + contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) + && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) + && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) + }} name: Unit uses: ./.github/workflows/bake.yml with: @@ -61,6 +66,7 @@ jobs: includes: ${{inputs.includes}} smoke: + if: inputs.cargo_profiles name: Smoke uses: ./.github/workflows/bake.yml with: @@ -73,11 +79,24 @@ jobs: rust_targets: ${{inputs.rust_targets}} sys_targets: ${{inputs.sys_targets}} machines: ${{inputs.machines}} - excludes: '[{"cargo_profile": "release", "rust_toolchain": "nightly"}, {"cargo_profile": "release-debuginfo", "rust_toolchain": "nightly"}, {"cargo_profile": "test", "feat_set": "default"}, {"cargo_profile": "release-max-perf", "rust_toolchain": "stable"}, {"cargo_profile": "release-max-perf", "feat_set": "none"}]' includes: ${{inputs.includes}} + excludes: > + [ + {"cargo_profile": "test", "feat_set": "default"}, + {"cargo_profile": "release", "rust_toolchain": "nightly"}, + {"cargo_profile": "release-debuginfo", "rust_toolchain": "nightly"}, + {"cargo_profile": "release-max-perf", "rust_toolchain": "stable"}, + {"cargo_profile": "release-max-perf", "feat_set": "none"} + ] complement: - if: ${{inputs.complement && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])}} + if: > + ${{ + inputs.complement + && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) + && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) + && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) + }} name: Complement uses: ./.github/workflows/bake.yml with: @@ -94,7 +113,13 @@ jobs: includes: ${{inputs.includes}} compliance: - if: ${{inputs.complement && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])}} + if: > + ${{ + inputs.complement + && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) + && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) + && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) + }} name: Matrix Compliance needs: [complement] runs-on: ${{matrix.machine}}