ci: Add manual workflow dispatch option for pipeline directives.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-01-16 10:19:29 +00:00
parent 38ae93fe42
commit c0aaeefaf2
2 changed files with 28 additions and 25 deletions

View File

@@ -11,6 +11,9 @@ on:
- "**" - "**"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
pipeline:
type: string
description: Specify e.g. '[ci only it]' here instead of commit message.
complement_logs: complement_logs:
type: boolean type: boolean
default: true default: true
@@ -61,7 +64,7 @@ jobs:
release_url: ${{steps.release.outputs.upload_url}} release_url: ${{steps.release.outputs.upload_url}}
pages_url: 'https://matrix-construct.github.io/tuwunel/' pages_url: 'https://matrix-construct.github.io/tuwunel/'
rust_sdk_integ: ${{vars.RUST_SDK_INTEGRATION != 'false'}} rust_sdk_integ: ${{vars.RUST_SDK_INTEGRATION != 'false'}}
head_msg: ${{github.event.head_commit.message || github.event.workflow_run.head_commit.message}} pipeline: ${{github.event.inputs.pipeline || github.event.head_commit.message || github.event.workflow_run.head_commit.message}}
strategy: strategy:
fail-fast: true fail-fast: true
@@ -130,8 +133,8 @@ jobs:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(github.ref, 'refs/tags/v') && !contains(github.ref, 'refs/tags/v')
&& !contains(needs.init.outputs.head_msg, '[ci no lint]') && !contains(needs.init.outputs.pipeline, '[ci no lint]')
&& !contains(needs.init.outputs.head_msg, '[ci only it]') && !contains(needs.init.outputs.pipeline, '[ci only it]')
name: Lint name: Lint
needs: [init] #needs: [init, deps] needs: [init] #needs: [init, deps]
@@ -180,13 +183,13 @@ jobs:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(github.ref, 'refs/tags/v') && !contains(github.ref, 'refs/tags/v')
&& !contains(needs.init.outputs.head_msg, '[ci no test]') && !contains(needs.init.outputs.pipeline, '[ci no test]')
name: Test name: Test
needs: [init, lint] needs: [init, lint]
uses: ./.github/workflows/test.yml uses: ./.github/workflows/test.yml
with: with:
head_msg: ${{needs.init.outputs.head_msg}} pipeline: ${{needs.init.outputs.pipeline}}
build_nix: ${{fromJSON(needs.init.outputs.build_nix)}} build_nix: ${{fromJSON(needs.init.outputs.build_nix)}}
rust_sdk_integ: ${{fromJSON(needs.init.outputs.rust_sdk_integ)}} rust_sdk_integ: ${{fromJSON(needs.init.outputs.rust_sdk_integ)}}
complement: ${{fromJSON(needs.init.outputs.complement)}} complement: ${{fromJSON(needs.init.outputs.complement)}}
@@ -237,9 +240,9 @@ jobs:
!failure() && !cancelled() !failure() && !cancelled()
&& needs.init.outputs.package && needs.init.outputs.package
&& !contains(github.ref, 'refs/pull') && !contains(github.ref, 'refs/pull')
&& !contains(needs.init.outputs.head_msg, '[ci only it]') && !contains(needs.init.outputs.pipeline, '[ci only it]')
&& !contains(needs.init.outputs.head_msg, '[ci no build]') && !contains(needs.init.outputs.pipeline, '[ci no build]')
&& !contains(needs.init.outputs.head_msg, '[ci no package]') && !contains(needs.init.outputs.pipeline, '[ci no package]')
name: Package name: Package
needs: [init, test] needs: [init, test]
@@ -301,10 +304,10 @@ jobs:
!failure() && !cancelled() !failure() && !cancelled()
&& needs.init.outputs.publish && needs.init.outputs.publish
&& !contains(github.ref, 'refs/pull') && !contains(github.ref, 'refs/pull')
&& !contains(needs.init.outputs.head_msg, '[ci only it]') && !contains(needs.init.outputs.pipeline, '[ci only it]')
&& !contains(needs.init.outputs.head_msg, '[ci no build]') && !contains(needs.init.outputs.pipeline, '[ci no build]')
&& !contains(needs.init.outputs.head_msg, '[ci no package]') && !contains(needs.init.outputs.pipeline, '[ci no package]')
&& !contains(needs.init.outputs.head_msg, '[ci no publish]') && !contains(needs.init.outputs.pipeline, '[ci no publish]')
name: Publish name: Publish
needs: [init, test, package] needs: [init, test, package]

View File

@@ -55,14 +55,14 @@ on:
build_nix: build_nix:
type: boolean type: boolean
default: true default: true
head_msg: pipeline:
type: string type: string
default: ${{github.event.workflow_run.head_commit.message}} default: ${{github.event.inputs.pipeline || github.event.workflow_run.head_commit.message}}
jobs: jobs:
docs: docs:
if: > if: >
!contains(inputs.head_msg, '[ci only it]') !contains(inputs.pipeline, '[ci only it]')
&& 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])
@@ -85,7 +85,7 @@ jobs:
unit: unit:
if: > if: >
!contains(inputs.head_msg, '[ci only it]') !contains(inputs.pipeline, '[ci only it]')
&& 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])
@@ -108,7 +108,7 @@ jobs:
bench: bench:
if: > if: >
!contains(inputs.head_msg, '[ci only it]') !contains(inputs.pipeline, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[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])
@@ -131,7 +131,7 @@ jobs:
memcheck: memcheck:
if: > if: >
!contains(inputs.head_msg, '[ci only it]') !contains(inputs.pipeline, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[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])
@@ -156,8 +156,8 @@ jobs:
smoke: smoke:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci only it]') && !contains(inputs.pipeline, '[ci only it]')
&& !contains(inputs.head_msg, '[ci no build]') && !contains(inputs.pipeline, '[ci no build]')
&& inputs.cargo_profiles && inputs.cargo_profiles
&& inputs.machines && inputs.machines
@@ -231,8 +231,8 @@ jobs:
nix: nix:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci only it]') && !contains(inputs.pipeline, '[ci only it]')
&& !contains(inputs.head_msg, '[ci no build]') && !contains(inputs.pipeline, '[ci no build]')
&& !contains(github.ref, 'refs/pull') && !contains(github.ref, 'refs/pull')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0]) && contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
@@ -258,7 +258,7 @@ jobs:
rust-sdk-integ: rust-sdk-integ:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]') && !contains(inputs.pipeline, '[ci no build]')
&& inputs.rust_sdk_integ && inputs.rust_sdk_integ
&& 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])
@@ -310,7 +310,7 @@ jobs:
complement: complement:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]') && !contains(inputs.pipeline, '[ci no build]')
&& inputs.complement && inputs.complement
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0]) && contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
@@ -335,7 +335,7 @@ jobs:
compliance: compliance:
if: > if: >
!failure() && !cancelled() !failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]') && !contains(inputs.pipeline, '[ci no build]')
&& inputs.complement && inputs.complement
&& inputs.machines && inputs.machines
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0]) && contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])