From eec5db2a6a902291581014c3d42164e57d7843b0 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Mon, 9 Jun 2025 20:42:01 +0800 Subject: [PATCH] test: add e2e test Build RPM with moke and re-build bootc image with new bootc RPM Signed-off-by: Xiaofeng Wang --- .github/workflows/e2e.yml | 68 +++++++++++++++++++++++++++++++++++ .packit.yaml | 8 +++-- contrib/scripts/mock_build.sh | 30 ++++++++++++++++ 3 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/e2e.yml create mode 100755 contrib/scripts/mock_build.sh diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 000000000..33d96a46f --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,68 @@ + +name: e2e + +# triggered by labeled PR +on: + pull_request_target: + types: [ labeled ] + workflow_dispatch: + +jobs: + test: + if: ${{ github.event.label.name == 'e2e' }} + strategy: + matrix: + # os: [ubuntu-latest, ubuntu-24.04-arm] + os: [ubuntu-latest] + # distro: [fedora-41, fedora-42, fedora-r43, centos-stream-9, centos-stream-10] + distro: [centos-stream-10] + runs-on: ${{ matrix.os }} + + # Required to push container image to ghcr.io + # https://github.com/orgs/community/discussions/57724 + permissions: + contents: read + packages: write + attestations: write + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Build bootc RPM + env: + DISTRO: ${{ matrix.distro }} + BUILD_IMAGE: quay.io/fedora/fedora:42 + run: | + podman run \ + --rm \ + --privileged \ + -v $(pwd):/workdir:z \ + -e DISTRO=$DISTRO \ + --workdir /workdir \ + $BUILD_IMAGE \ + contrib/scripts/mock_build.sh + + - name: Re-build bootc image with new bootc PRM + env: + DISTRO: ${{ matrix.distro }} + run: | + set -xeu + if [[ $DISTRO =~ fedora ]]; then + VERSION_ID=$(cut -d'-' -f2 <<<"$DISTRO") + BASE_IMAGE="quay.io/fedora/fedora-bootc:${VERSION_ID}" + fi + if [[ $DISTRO =~ centos ]]; then + VERSION_ID=$(cut -d'-' -f3 <<<"$DISTRO") + BASE_IMAGE="quay.io/centos-bootc/centos-bootc:stream${VERSION_ID}" + fi + tee target/build/Containerfile >/dev/null <