Skip to content

Commit dcd79a9

Browse files
Add support for manual workflows, runner label matching (#41069)
Co-authored-by: Pete Peterson <peterfpeterson@gmail.com>
1 parent e7ec32e commit dcd79a9

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

.github/workflows/linux_build_and_test.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,47 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
workflow_dispatch:
8+
inputs:
9+
RUNNER_LABEL:
10+
description: 'Match Runner Label'
11+
required: false
12+
type: string
13+
14+
715
# cancel previous job if a new commit is pushed
816
concurrency:
917
group: ${{ github.workflow }}-${{ github.ref }}
1018
cancel-in-progress: true
1119

1220
jobs:
1321
linux-build-and-test:
14-
runs-on: [self-hosted, linux, x64]
22+
runs-on:
23+
- ${{ (inputs.RUNNER_LABEL == '' && 'self-hosted') || inputs.RUNNER_LABEL }}
24+
- self-hosted
25+
- Linux
26+
- X64
27+
#
28+
# If the user who clicked "Run Workflow" button left the RUNNER_LABEL field blank,
29+
# the default evaluated output is the string 'self-hosted'.
30+
# Otherwise set it to the value the user specified when they clicked "Run Workflow"
31+
#
32+
1533
steps:
34+
- name: Print shell environment vars (debug)
35+
if: github.event_name == 'workflow_dispatch'
36+
run: |
37+
env -0 | while IFS='' read -d '' line ; do printf '%s\t: %s\n' "${line%%=*}" "${line#*=}" | expand -t 30 | sed ':a;N;$!ba;s/\n/ /g'; done | LC_COLLATE=C sort -b
38+
#
39+
# If this workflow was triggered manually,
40+
# print a sorted list of all shell environment variables
41+
#
42+
1643
- uses: actions/checkout@v4
1744
with:
1845
# Needed to fetch the tags for versioningit
19-
fetch-depth: "0"
46+
fetch-depth: 100
47+
fetch-tags: true
2048

2149
- name: Run unit tests and system tests on Linux
2250
run: ${GITHUB_WORKSPACE}/buildconfig/Jenkins/Conda/conda-buildscript ${GITHUB_WORKSPACE} linux-64-ci --enable-systemtests

0 commit comments

Comments
 (0)