|
| 1 | +name: crc-e2e-builder |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: [ 'crc-e2e-v*' ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + paths: ['crc-e2e/**', '.github\/workflows\/crc-e2e*' ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: build |
| 13 | + runs-on: ubuntu-24.04 |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + # Allow emulation for building multi arch images |
| 19 | + - name: Prepare runner |
| 20 | + shell: bash |
| 21 | + run: | |
| 22 | + sudo apt-get install -y qemu-user-static |
| 23 | +
|
| 24 | + - name: Build image for PR |
| 25 | + if: ${{ github.event_name == 'pull_request' }} |
| 26 | + env: |
| 27 | + CRC_E2E: ghcr.io/crc-org/ci-crc-e2e |
| 28 | + CRC_E2E_V: pr-${{ github.event.number }} |
| 29 | + run: | |
| 30 | + make crc-e2e-oci-build |
| 31 | + make crc-e2e-oci-save |
| 32 | + echo "image=${CRC_E2E}:${CRC_E2E_V}" >> "$GITHUB_ENV" |
| 33 | + |
| 34 | + - name: Build image for Release |
| 35 | + if: ${{ github.event_name == 'push' }} |
| 36 | + run: | |
| 37 | + make crc-e2e-oci-build |
| 38 | + make crc-e2e-oci-save |
| 39 | + echo "image=$(sed -n 1p crc-e2e/release-info):v$(sed -n 2p crc-e2e/release-info)" >> "$GITHUB_ENV" |
| 40 | +
|
| 41 | + - name: Create image metadata |
| 42 | + run: | |
| 43 | + echo ${{ env.image }} > crc-e2e-image |
| 44 | + echo ${{ github.event_name }} > crc-e2e-build-event |
| 45 | + |
| 46 | + - name: Upload crc-e2e |
| 47 | + uses: actions/upload-artifact@v4 |
| 48 | + with: |
| 49 | + name: crc-e2e |
| 50 | + path: crc-e2e* |
| 51 | + |
| 52 | + tkn-check: |
| 53 | + runs-on: ubuntu-24.04 |
| 54 | + steps: |
| 55 | + - name: Checkout code |
| 56 | + uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Template tkn for PR |
| 59 | + if: ${{ github.event_name == 'pull_request' }} |
| 60 | + env: |
| 61 | + CRC_E2E: ghcr.io/crc-org/ci-crc-e2e |
| 62 | + CRC_E2E_V: pr-${{ github.event.number }} |
| 63 | + run: | |
| 64 | + make crc-e2e-tkn-create |
| 65 | +
|
| 66 | + - name: Check tkn specs |
| 67 | + run: | |
| 68 | + if [[ ! -f crc-e2e/tkn/crc-e2e-installer.yaml ]]; then |
| 69 | + exit 1 |
| 70 | + fi |
| 71 | + if [[ ! -f crc-e2e/tkn/crc-e2e.yaml ]]; then |
| 72 | + exit 1 |
| 73 | + fi |
| 74 | + # Check if version is in sync |
| 75 | +
|
| 76 | + - name: Create k8s Kind Cluster |
| 77 | + uses: helm/kind-action@v1 |
| 78 | + |
| 79 | + # https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html |
| 80 | + - name: Deploy min supported tekton version |
| 81 | + run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml |
| 82 | + |
| 83 | + - name: Deploy tasks |
| 84 | + run: | |
| 85 | + kubectl apply -f crc-e2e/tkn/crc-e2e-installer.yaml |
| 86 | + kubectl apply -f crc-e2e/tkn/crc-e2e.yaml |
| 87 | +
|
| 88 | + - name: Upload crc-e2e-tkn |
| 89 | + uses: actions/upload-artifact@v4 |
| 90 | + with: |
| 91 | + name: crc-e2e-tkn |
| 92 | + path: crc-e2e/tkn/crc-e2e* |
0 commit comments