From 04c26b03cfb3de24f679afb11f52128e343e9b85 Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Mon, 5 Feb 2024 22:19:35 +0100 Subject: [PATCH] tmt: automatically determine copr version matrix Fixes #79 --- .github/workflows/tmt.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tmt.yml b/.github/workflows/tmt.yml index 1f996e53..e7b1674d 100644 --- a/.github/workflows/tmt.yml +++ b/.github/workflows/tmt.yml @@ -15,12 +15,25 @@ permissions: actions: write jobs: + get-os-versions-job: + runs-on: ubuntu-latest + outputs: + os-versions: ${{ steps.get-os-versions-step.outputs.os_versions }} + steps: + - id: get-os-versions-step + run: | + sudo apt-get install jq curl + os_versions=`curl -sL https://copr.fedorainfracloud.org/api_3/mock-chroots/list | jq -rc '[. | keys[] | select(.|match("fedora-[0-9]+|rawhide")) | sub("^fedora-"; "") | sub("-.*$";"")] | unique'` + # Get OS versions comma separated with properly quoted rawhide + >&2 echo "$os_versions" + echo "os_versions=$os_versions" >> $GITHUB_OUTPUT run-tmt: + needs: get-os-versions-job strategy: fail-fast: false matrix: os: [fedora] - version: [38, 39, rawhide] + version: ${{ fromJSON(needs.get-os-versions-job.outputs.os-versions) }} strategy: [standalone, big-merge, bootstrap] include: - strategy: standalone