ci: Workaround multi-line if-condition github bug; cleanup.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-06-01 20:19:18 +00:00
parent 841253692d
commit 873cac5731
7 changed files with 115 additions and 93 deletions

View File

@@ -65,11 +65,9 @@ on:
jobs: jobs:
bake: bake:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && fromJSON(inputs.machines)[0] != null
&& fromJSON(inputs.machines)[0] != null && fromJSON(inputs.bake_targets)[0] != null
&& fromJSON(inputs.bake_targets)[0] != null
}}
name: > name: >
${{matrix.bake_target}} ${{matrix.bake_target}}
@@ -124,7 +122,11 @@ jobs:
# Optionally extract an inner artifact # Optionally extract an inner artifact
- name: Extract Artifact - name: Extract Artifact
if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst && fromJSON(inputs.artifact)[matrix.bake_target].img == null }} if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].img == null
env: env:
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}} iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }} dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
@@ -138,7 +140,11 @@ jobs:
# Optionally extract the image itself as an artifact. # Optionally extract the image itself as an artifact.
- name: Extract Image - name: Extract Image
if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst && fromJSON(inputs.artifact)[matrix.bake_target].img != null }} if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
&& fromJSON(inputs.artifact)[matrix.bake_target].img != null
env: env:
iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}} iid: ${{matrix.bake_target}}--${{matrix.cargo_profile}}--${{matrix.rust_toolchain}}--${{matrix.rust_target}}--${{matrix.feat_set}}--${{matrix.sys_name}}--${{matrix.sys_version}}--${{matrix.sys_target}}
dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }} dst: ${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}
@@ -150,7 +156,10 @@ jobs:
# Upload either artifact # Upload either artifact
- name: Upload Artifact - name: Upload Artifact
if: ${{ !failure() && !cancelled() && fromJSON(inputs.artifact)[matrix.bake_target].dst }} if: >
!failure() && !cancelled()
&& fromJSON(inputs.artifact)[matrix.bake_target].dst
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
path: _artifact/${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }} path: _artifact/${{ fromJSON(inputs.artifact)[matrix.bake_target].dst }}

View File

@@ -54,7 +54,10 @@ on:
jobs: jobs:
systems: systems:
if: ${{ !failure() && !cancelled() && inputs.show_systems }} if: >
!failure() && !cancelled()
&& inputs.show_systems
name: System name: System
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -71,7 +74,10 @@ jobs:
includes: ${{inputs.includes}} includes: ${{inputs.includes}}
buildsys: buildsys:
if: ${{ !failure() && !cancelled() && inputs.show_systems }} if: >
!failure() && !cancelled()
&& inputs.show_systems
name: Builder name: Builder
needs: [systems] needs: [systems]
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
@@ -89,7 +95,10 @@ jobs:
includes: ${{inputs.includes}} includes: ${{inputs.includes}}
sources: sources:
if: ${{ !failure() && !cancelled() && inputs.show_sources }} if: >
!failure() && !cancelled()
&& inputs.show_sources
name: Acquire name: Acquire
needs: [buildsys] needs: [buildsys]
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
@@ -107,7 +116,10 @@ jobs:
includes: ${{inputs.includes}} includes: ${{inputs.includes}}
rocksdb: rocksdb:
if: ${{ !failure() && !cancelled() && inputs.show_rocksdb }} if: >
!failure() && !cancelled()
&& inputs.show_rocksdb
name: RocksDB name: RocksDB
needs: [sources] needs: [sources]
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
@@ -125,7 +137,10 @@ jobs:
includes: ${{inputs.includes}} includes: ${{inputs.includes}}
deps: deps:
if: ${{ !failure() && !cancelled() && inputs.show_cargo }} if: >
!failure() && !cancelled()
&& inputs.show_cargo
name: Build name: Build
needs: [rocksdb] needs: [rocksdb]
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml

View File

@@ -39,12 +39,11 @@ on:
jobs: jobs:
fmt: fmt:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Format name: Format
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -62,12 +61,11 @@ jobs:
typos: typos:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Typos name: Typos
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -85,12 +83,11 @@ jobs:
audit: audit:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Audit name: Audit
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -108,12 +105,11 @@ jobs:
lychee: lychee:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Lychee name: Lychee
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -131,10 +127,9 @@ jobs:
clippy: clippy:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && inputs.cargo_profiles
&& inputs.cargo.profiles
}}
name: Clippy name: Clippy
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:

View File

@@ -17,16 +17,6 @@ jobs:
init: init:
name: Init name: Init
runs-on: self-hosted runs-on: self-hosted
outputs:
cargo_profiles: ${{vars.CARGO_PROFILES || env.default_cargo_profiles}}
feat_sets: ${{vars.FEAT_SETS || env.default_feat_sets}}
rust_toolchains: ${{vars.RUST_TOOLCHAINS || env.default_rust_toolchains}}
rust_targets: ${{vars.RUST_TARGETS || env.default_rust_targets}}
sys_names: ${{vars.SYS_NAMES || env.default_sys_names}}
sys_targets: ${{vars.SYS_TARGETS || env.default_sys_targets}}
sys_versions: ${{vars.SYS_VERSIONS || env.default_sys_versions}}
machines: ${{vars.MACHINES || env.default_machines}}
excludes: ${{vars.EXCLUDES || env.default_excludes}}
env: env:
default_cargo_profiles: '["test", "release"]' default_cargo_profiles: '["test", "release"]'
default_feat_sets: '["none", "default", "all"]' default_feat_sets: '["none", "default", "all"]'
@@ -42,6 +32,18 @@ jobs:
{"cargo_profile": "release-max-perf", "rust_toolchain": "stable"}, {"cargo_profile": "release-max-perf", "rust_toolchain": "stable"},
{"cargo_profile": "release-max-perf", "feat_set": "none"} {"cargo_profile": "release-max-perf", "feat_set": "none"}
] ]
outputs:
cargo_profiles: ${{vars.CARGO_PROFILES || env.default_cargo_profiles}}
feat_sets: ${{vars.FEAT_SETS || env.default_feat_sets}}
rust_toolchains: ${{vars.RUST_TOOLCHAINS || env.default_rust_toolchains}}
rust_targets: ${{vars.RUST_TARGETS || env.default_rust_targets}}
sys_names: ${{vars.SYS_NAMES || env.default_sys_names}}
sys_targets: ${{vars.SYS_TARGETS || env.default_sys_targets}}
sys_versions: ${{vars.SYS_VERSIONS || env.default_sys_versions}}
machines: ${{vars.MACHINES || env.default_machines}}
excludes: ${{vars.EXCLUDES || env.default_excludes}}
steps: steps:
- name: Initialize Builder - name: Initialize Builder
run: | run: |
@@ -92,7 +94,9 @@ jobs:
# ] # ]
lint: lint:
if: ${{ !failure() && !cancelled() }} if: >
!failure() && !cancelled()
name: Lint name: Lint
needs: [init] #needs: [init, deps] needs: [init] #needs: [init, deps]
uses: ./.github/workflows/lint.yml uses: ./.github/workflows/lint.yml
@@ -108,7 +112,9 @@ jobs:
excludes: ${{needs.init.outputs.excludes}} excludes: ${{needs.init.outputs.excludes}}
test: test:
if: ${{ !failure() && !cancelled() }} if: >
!failure() && !cancelled()
name: Test name: Test
needs: [init, lint] needs: [init, lint]
uses: ./.github/workflows/test.yml uses: ./.github/workflows/test.yml
@@ -125,7 +131,9 @@ jobs:
complement: ${{fromJSON(vars.COMPLEMENT || 'true')}} complement: ${{fromJSON(vars.COMPLEMENT || 'true')}}
package: package:
if: ${{ !failure() && !cancelled() }} if: >
!failure() && !cancelled()
name: Package name: Package
needs: [init, lint] needs: [init, lint]
uses: ./.github/workflows/package.yml uses: ./.github/workflows/package.yml
@@ -148,7 +156,9 @@ jobs:
] ]
publish: publish:
if: ${{ !failure() && !cancelled() }} if: >
!failure() && !cancelled()
name: Publish name: Publish
needs: [init, test, package] needs: [init, test, package]
uses: ./.github/workflows/publish.yml uses: ./.github/workflows/publish.yml

View File

@@ -39,9 +39,8 @@ on:
jobs: jobs:
build_standalone: build_standalone:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled()
}}
name: Standalone name: Standalone
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -64,12 +63,11 @@ jobs:
build_pkgs: build_pkgs:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
}}
name: Build Pkgs name: Build Pkgs
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -92,12 +90,11 @@ jobs:
check_pkgs: check_pkgs:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
}}
name: Check Pkgs name: Check Pkgs
needs: [build_pkgs] needs: [build_pkgs]
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml

View File

@@ -45,12 +45,11 @@ on:
jobs: jobs:
containers: containers:
if: > if: >
${{ !failure() && !cancelled()
!failure() && !cancelled() && inputs.machines
&& inputs.machines && inputs.docker_repo != ''
&& inputs.docker_repo != '' && github.ref == 'refs/heads/main'
&& github.ref == 'refs/heads/main'
}}
name: Publish containers name: Publish containers
runs-on: ${{matrix.machine}} runs-on: ${{matrix.machine}}
permissions: write-all permissions: write-all

View File

@@ -45,11 +45,10 @@ on:
jobs: jobs:
unit: unit:
if: > if: >
${{ contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Unit name: Unit
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -91,12 +90,11 @@ jobs:
complement: complement:
if: > if: >
${{ inputs.complement
inputs.complement && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.complement_feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.complement_feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Complement name: Complement
uses: ./.github/workflows/bake.yml uses: ./.github/workflows/bake.yml
with: with:
@@ -114,12 +112,11 @@ jobs:
compliance: compliance:
if: > if: >
${{ inputs.complement
inputs.complement && contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0])
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["test"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
}}
name: Matrix Compliance name: Matrix Compliance
needs: [complement] needs: [complement]
runs-on: ${{matrix.machine}} runs-on: ${{matrix.machine}}