Skip to content

Commit

Permalink
Support runner selection in the test matrix
Browse files Browse the repository at this point in the history
For now we can use free hosted runners for testbot tests
and only use self-hosted with KVM for qemu tests.

Change-type: patch
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Jun 19, 2024
1 parent 2e608ae commit 1b1f1d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/generic-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ jobs:
{
"test_suite": ["os","cloud","hup"],
"environment": ["bm.balena-dev.com"],
"worker_type": ["qemu"]
"worker_type": ["qemu"],
"runs_on": [["self-hosted", "X64", "kvm"]]
}
19 changes: 14 additions & 5 deletions .github/workflows/yocto-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ on:
default: >
[
"self-hosted",
"X64"
"X64",
"16cpu"
]
device-repo:
description: balenaOS device repository (owner/repo)
Expand Down Expand Up @@ -92,8 +93,13 @@ on:
required: false
type: boolean
default: ${{ github.event_name == 'push' }} # This determines if we want to check the results of the merge PR - we only want to do it when a new tag is made
<<<<<<< HEAD

Check failure on line 96 in .github/workflows/yocto-build-deploy.yml

View workflow job for this annotation

GitHub Actions / Flowzone / Lint workflows

could not parse as YAML: yaml: line 96: could not find expected ':'
# FIXME: remove this input and set "test_matrix: {}" to skip tests. The open PR event type check can be moved to the job conditions.
# Additionally, we may want to change the default test_matrix to {} and make tests opt-in.
=======
# FIXME: remove this input and set "test_matrix: []" to skip tests. The open PR event type check can be moved to the job conditions.
# Additionally, we may want to change the default test_matrix to [] and make tests opt-in.
>>>>>>> 25f10e3 (Support runner selection in the test matrix)
run-tests:
required: false
type: boolean
Expand Down Expand Up @@ -136,6 +142,7 @@ on:
# - worker_type: The worker type to use for testing. The valid worker types are `qemu` and `testbot`. The default worker type is `testbot`
# - worker_fleets: The testbot fleets for finding available Leviathan workers. Not used for QEMU workers. Can accept a list of apps separated by commas, no spaces in between
# - test_org: The organization to use for testing cloud functionality. This default org is `testbot`
# - runs_on: A JSON array of runner labels to use for the job(s). For qemu workers use the labels `["self-hosted", "X64", "kvm"]`.
# To use specific settings for each test job, create an include array like this...
# {"include": [
# {
Expand All @@ -145,19 +152,21 @@ on:
# {
# "test_suite": "cloud",
# "environment": "balena-cloud.com",
# "worker_type": "qemu"
# "test_org": "testbot"
# },
# {
# "test_suite": "hup",
# "environment": "balena-cloud.com",
# "worker_type": "qemu"
# "worker_type": "qemu",
# "runs_on": ["self-hosted", "X64", "kvm"]
# }
# ]}
# Otherwise for a combinatorial matrix (the default) just provide values like this to have the matrix expanded...
# {
# "test_suite": ["os","cloud","hup"],
# "environment": ["bm.balena-dev.com"],
# "worker_type": ["qemu","testbot"]
# "worker_type": ["qemu","testbot"],
# "runs_on": [["self-hosted", "X64", "kvm"]]
# }
test_matrix:
description: "JSON Leviathan test matrix to use for testing. If not provided, the default testbot matrix will be used."
Expand Down Expand Up @@ -982,7 +991,7 @@ jobs:
test:
name: Test
needs: build
runs-on: ${{ fromJSON(inputs.runs-on) }}
runs-on: ${{ fromJSON(matrix.runs_on || '["ubuntu-22.04"]') }}
if: inputs.run-tests == true
environment: ${{ matrix.environment }}

Expand Down

0 comments on commit 1b1f1d6

Please sign in to comment.