Skip to content

Commit

Permalink
feat: allow pinning qemu provider
Browse files Browse the repository at this point in the history
Signed-off-by: You-Sheng Yang <[email protected]>
  • Loading branch information
vicamo committed Apr 15, 2024
1 parent 9bb1332 commit 0ecdf4f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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)
})')"
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/per-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ecdf4f

Please sign in to comment.