Files
tuwunel/.github/workflows/test.yml
Jason Volk aa27ab855b Add rpm package to workflow.
Improve workflows.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-05-09 22:26:47 +00:00

148 lines
5.2 KiB
YAML

name: Testing
on:
workflow_call:
inputs:
cargo_profiles:
type: string
description: Cargo profiles
feat_sets:
type: string
description: Cargo feature groups
rust_toolchains:
type: string
description: Rust toolchains
sys_names:
type: string
description: System names
sys_versions:
type: string
description: System versions
rust_targets:
type: string
description: Rust targets
sys_targets:
type: string
description: System targets
machines:
type: string
description: Hardware platform vector
excludes:
type: string
default: '[]'
description: Matrix exclusions
includes:
type: string
default: '[]'
description: Matrix inclusions
complement:
type: boolean
default: true
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])}}
name: Unit
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["tests-unit"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
smoke:
name: Smoke
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["tests-smoke"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: ${{inputs.feat_sets}}
rust_toolchains: ${{inputs.rust_toolchains}}
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: '[{"cargo_profile": "release", "rust_toolchain": "nightly"}, {"cargo_profile": "test", "feat_set": "default"}]'
includes: ${{inputs.includes}}
complement_tester:
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 Tester
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["complement-tester"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
complement_testee:
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 Testee
uses: ./.github/workflows/bake.yml
needs: [smoke]
with:
bake_targets: '["complement-testee"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: ${{inputs.rust_targets}}
sys_targets: ${{inputs.sys_targets}}
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
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])}}
name: Matrix Compliance
needs: [complement_tester, complement_testee]
runs-on: ${{matrix.machine}}
concurrency:
group: complement-cant-walk-and-chew-bubblegum
cancel-in-progress: false
strategy:
fail-fast: false
matrix:
cargo_profile: ${{fromJSON('["test"]')}}
rust_toolchain: ${{fromJSON('["nightly"]')}}
feat_set: ${{fromJSON('["all"]')}}
sys_name: ${{fromJSON(inputs.sys_names)}}
sys_version: ${{fromJSON(inputs.sys_versions)}}
rust_target: ${{fromJSON(inputs.rust_targets)}}
sys_target: ${{fromJSON(inputs.sys_targets)}}
machine: ${{fromJSON(inputs.machines)}}
exclude: ${{fromJSON(inputs.excludes)}}
include: ${{fromJSON(inputs.includes)}}
steps:
- name: Complement
env:
cargo_profile: ${{matrix.cargo_profile}}
rust_toolchain: ${{matrix.rust_toolchain}}
rust_target: ${{matrix.rust_target}}
feat_set: ${{matrix.feat_set}}
sys_name: ${{matrix.sys_name}}
sys_target: ${{matrix.sys_target}}
sys_version: ${{matrix.sys_version}}
machine: ${{matrix.machine}}
run: |
docker/complement.sh