test: add e2e test #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: e2e test | |
| # triggered by labeled PR | |
| on: | |
| pull_request: | |
| types: [ labeled ] | |
| jobs: | |
| e2e-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 }} | |
| 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 }} | |
| PR_NUMBER: ${{ github.event.number }} | |
| 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 <<CONTAINERFILEEOF | |
| FROM $BASE_IMAGE | |
| RUN dnf -y upgrade /rpms/*.rpm && dnf -y clean all && rm -rf /var/cache /var/lib/dnf | |
| CONTAINERFILEEOF | |
| cat target/build/Containerfile | |
| IMAGE_NAME="${DISTRO}:PR-${PR_NUMBER}-$(uname -m)" | |
| podman build -v "$(pwd)/target/build/":/rpms:z -t $IMAGE_NAME target/build | |
| podman push $IMAGE_NAME "docker://ghcr.io/bootc-dev/bootc/$IMAGE_URL" |