mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 02:35:37 +01:00
115 lines
4.5 KiB
YAML
115 lines
4.5 KiB
YAML
name: Release RPM smoke
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
run-id:
|
|
description: Release run containing both RPM artifacts (empty selects the latest available pair)
|
|
type: string
|
|
default: ""
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/release-rpm-smoke.yml
|
|
- .github/scripts/release-rpm-smoke.py
|
|
- .github/scripts/tests/test_release_rpm_smoke.py
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
source:
|
|
permissions:
|
|
actions: read
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 5
|
|
outputs:
|
|
run-id: ${{ steps.source.outputs.run-id }}
|
|
steps:
|
|
- id: source
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
RUN_ID: ${{ inputs.run-id }}
|
|
run: |
|
|
candidates="$RUN_ID"
|
|
if [ -z "$candidates" ]; then
|
|
candidates=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release.yml --branch release --limit 10 --json databaseId --jq '.[].databaseId')
|
|
fi
|
|
for candidate in $candidates; do
|
|
[[ "$candidate" =~ ^[0-9]+$ ]]
|
|
names=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$candidate/artifacts?per_page=100" --jq '.artifacts[] | select(.expired == false) | .name')
|
|
if grep -Fxq release-linux-x86_64 <<< "$names" && grep -Fxq release-linux-aarch64 <<< "$names"; then
|
|
printf 'run-id=%s\n' "$candidate" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
done
|
|
echo '::error::No release run has both Linux package artifacts available'
|
|
exit 1
|
|
smoke:
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
needs: source
|
|
timeout-minutes: 25
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- {arch: x86_64, runner: ubuntu-24.04}
|
|
- {arch: aarch64, runner: ubuntu-24.04-arm}
|
|
distro: [fedora, rocky, opensuse]
|
|
runs-on: ${{ matrix.platform.runner }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Download the release packages
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
RUN_ID: ${{ needs.source.outputs.run-id }}
|
|
ARCH: ${{ matrix.platform.arch }}
|
|
run: |
|
|
[[ "$RUN_ID" =~ ^[0-9]+$ ]]
|
|
mkdir -p packages results
|
|
gh run view "$RUN_ID" --json headSha,url > results/source.json
|
|
gh run download "$RUN_ID" --name "release-linux-$ARCH" --dir packages
|
|
sha256sum packages/*.rpm > results/rpm-sha256.txt
|
|
- name: Install and start the RPM on the target distribution
|
|
env:
|
|
DISTRO: ${{ matrix.distro }}
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y xvfb
|
|
Xvfb :99 -screen 0 1440x900x24 -ac -nolisten tcp > results/xvfb.log 2>&1 &
|
|
for _attempt in {1..20}; do
|
|
[ -S /tmp/.X11-unix/X99 ] && break
|
|
sleep 1
|
|
done
|
|
[ -S /tmp/.X11-unix/X99 ]
|
|
case "$DISTRO" in
|
|
fedora) image=fedora:latest ;;
|
|
rocky) image=rockylinux:10 ;;
|
|
opensuse) image=opensuse/tumbleweed:latest ;;
|
|
esac
|
|
docker pull "$image"
|
|
docker image inspect "$image" --format '{{json .RepoDigests}}' > results/container-digest.json
|
|
docker run --rm --ipc=host --name rpm-smoke -e DISTRO -e DISPLAY=:99 -e LIBGL_ALWAYS_SOFTWARE=1 \
|
|
-v /tmp/.X11-unix:/tmp/.X11-unix:ro -v "$PWD/packages:/packages:ro" \
|
|
-v "$PWD/results:/results" -v "$PWD/.github/scripts:/checks:ro" "$image" bash -euc '
|
|
cat /etc/os-release > /results/os-release.txt
|
|
if [ "$DISTRO" = opensuse ]; then
|
|
zypper --non-interactive refresh
|
|
zypper --non-interactive install python3 Mesa-dri Mesa-libEGL1 libX11-6 libXcursor1 libXi6 libXrandr2 libxkbcommon0 libxkbcommon-x11-0
|
|
zypper --non-interactive --no-gpg-checks install /packages/*.rpm
|
|
else
|
|
dnf -y install python3 mesa-dri-drivers mesa-libEGL libX11 libXcursor libXi libXrandr libxkbcommon libxkbcommon-x11
|
|
dnf -y --nogpgcheck install /packages/*.rpm
|
|
fi
|
|
rpm -qp --requires /packages/*.rpm > /results/rpm-requires.txt
|
|
python3 /checks/release-rpm-smoke.py
|
|
'
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
|
|
if: always()
|
|
with:
|
|
name: rpm-smoke-${{ matrix.distro }}-${{ matrix.platform.arch }}
|
|
path: results/
|
|
if-no-files-found: error
|