From 0ecdf4f857f39df0ae80b4212b483da509aff965 Mon Sep 17 00:00:00 2001 From: You-Sheng Yang Date: Mon, 15 Apr 2024 23:30:03 +0800 Subject: [PATCH] feat: allow pinning qemu provider Signed-off-by: You-Sheng Yang --- .github/workflows/ci.yml | 15 +++++++++++++++ .github/workflows/per-suite.yml | 11 ++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8e935d6f..63f1a63d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,15 @@ jobs: ["buster", "ppc64el", "2024/04/13 14:49:39"], ["buster", "s390x", "2024/04/13 14:49:39"] ]' + pin_qemu='[ + ["any", "alpha", "ubuntu"], + ["any", "hppa", "ubuntu"], + ["any", "powerpc", "ubuntu"], + ["any", "ppc64el", "ubuntu"], + ["any", "sh4", "ubuntu"], + ["any", "sparc", "ubuntu"], + ["any", "sparc64", "ubuntu"] + ]' codenames="$(echo "${FULL_JSON}" | jq -c -M 'map(select(.codename as $c | @@ -104,6 +113,12 @@ jobs: '"${pin_timestamp}"' | map(select((.[0] == $s.codename) and (.[1] == $arch)) | .[2]) | first), + "qemu":(. as $arch | + '"${pin_qemu}"' | + map(select(((.[0] == $s.codename) and (.[1] == $arch)) + or ((.[0] == "any") and (.[1] == $arch)) + or ((.[0] == $s.codename) and (.[1] == "any"))) | .[2]) | + first), }) | tostring) })')" diff --git a/.github/workflows/per-suite.yml b/.github/workflows/per-suite.yml index 501a56319..d7939c885 100644 --- a/.github/workflows/per-suite.yml +++ b/.github/workflows/per-suite.yml @@ -63,9 +63,14 @@ jobs: # Use the snapshot from yesterday to preven under sync. SNAPSHOT_DATE: ${{ matrix.timestamp || 'yesterday' }} steps: - - # Add support for more platforms with QEMU (optional) - name: Set up QEMU - if: matrix.arch != 'amd64' && matrix.arch != 'i386' + - name: Set up QEMU (docker/setup-qemu-action) + if: !matrix.qemu && matrix.arch != 'amd64' && matrix.arch != 'i386' + uses: docker/setup-qemu-action@v3 + + - name: Set up QEMU (Ubuntu) + if: + matrix.qemu == 'ubuntu' && matrix.arch != 'amd64' && matrix.arch != + 'i386' run: | echo "deb http://archive.ubuntu.com/ubuntu/ devel main universe" | \ sudo tee /etc/apt/sources.list.d/devel.list