|
| 1 | + |
| 2 | +name: e2e test |
| 3 | + |
| 4 | +# triggered by labeled PR |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + types: [ labeled ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + e2e-test: |
| 11 | + if: ${{ github.event.label.name == 'e2e' }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + # os: [ubuntu-latest, ubuntu-24.04-arm] |
| 15 | + os: [ubuntu-latest] |
| 16 | + # distro: [fedora-41, fedora-42, fedora-r43, centos-stream-9, centos-stream-10] |
| 17 | + distro: [centos-stream-10] |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + |
| 20 | + # Required to push container image to ghcr.io |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + packages: write |
| 24 | + attestations: write |
| 25 | + id-token: write |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Build bootc RPM |
| 31 | + env: |
| 32 | + DISTRO: ${{ matrix.distro }} |
| 33 | + BUILD_IMAGE: quay.io/fedora/fedora:42 |
| 34 | + run: | |
| 35 | + podman run \ |
| 36 | + --rm \ |
| 37 | + --privileged \ |
| 38 | + -v $(pwd):/workdir:z \ |
| 39 | + -e DISTRO=$DISTRO \ |
| 40 | + --workdir /workdir \ |
| 41 | + $BUILD_IMAGE \ |
| 42 | + contrib/scripts/mock_build.sh |
| 43 | +
|
| 44 | + - name: Re-build bootc image with new bootc PRM |
| 45 | + env: |
| 46 | + DISTRO: ${{ matrix.distro }} |
| 47 | + PR_NUMBER: ${{ github.event.number }} |
| 48 | + run: | |
| 49 | + set -xeu |
| 50 | + if [[ $DISTRO =~ fedora ]]; then |
| 51 | + VERSION_ID=$(cut -d'-' -f2 <<<"$DISTRO") |
| 52 | + BASE_IMAGE="quay.io/fedora/fedora-bootc:${VERSION_ID}" |
| 53 | + fi |
| 54 | + if [[ $DISTRO =~ centos ]]; then |
| 55 | + VERSION_ID=$(cut -d'-' -f3 <<<"$DISTRO") |
| 56 | + BASE_IMAGE="quay.io/centos-bootc/centos-bootc:stream${VERSION_ID}" |
| 57 | + fi |
| 58 | + tee target/build/Containerfile >/dev/null <<CONTAINERFILEEOF |
| 59 | + FROM $BASE_IMAGE |
| 60 | + RUN dnf -y upgrade /rpms/*.rpm && dnf -y clean all && rm -rf /var/cache /var/lib/dnf |
| 61 | + CONTAINERFILEEOF |
| 62 | + cat target/build/Containerfile |
| 63 | +
|
| 64 | + IMAGE_NAME="bootc-image:PR-${PR_NUMBER}-${DISTRO}-$(uname -m)" |
| 65 | + podman build -v "$(pwd)/target/build/":/rpms:z -t $IMAGE_NAME target/build |
| 66 | + podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io |
| 67 | + podman push $IMAGE_NAME "docker://ghcr.io/bootc-dev/$IMAGE_NAME" |
0 commit comments