From 6c5720437d11578dc5a00b6acbc5f354e89895c4 Mon Sep 17 00:00:00 2001 From: Jakub Sliacan Date: Mon, 4 Dec 2023 17:04:12 +0100 Subject: [PATCH] [to-be-removed] add build workflow --- .github/workflows/build-tests.yml | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build-tests.yml diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml new file mode 100644 index 0000000000..19f09a6839 --- /dev/null +++ b/.github/workflows/build-tests.yml @@ -0,0 +1,66 @@ +name: Build test images +on: +# push: +# branches: +# - "main" + pull_request: {} + +env: + REGISTRY: ghcr.io + IMAGE_NAME_E2E: crc-e2e + IMAGE_NAME_INTEGRATION: crc-integration + +jobs: + build-e2e: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Build e2e image + env: + PR_NUMBER: ${{ github.event.number }} + run: | + CRC_E2E_IMG_VERSION=pr-${PR_NUMBER} IMG_E2E=${{ env.REGISTRY}}/${{ github.repository_owner }}/${{env.IMAGE_NAME_E2E}}:${CRC_E2E_IMG_VERSION} make containerized_e2e + + - name: Archive e2e image + env: + PR_NUMBER: ${{ github.event.number }} + run: | + podman save -o ${{ env.IMAGE_NAME_E2E }}.tar ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{env.IMAGE_NAME_E2E}}:pr-${PR_NUMBER} + + - name: Upload e2e artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.IMAGE_NAME_E2E }}-pr${{ github.event.number }} + path: ${{ env.IMAGE_NAME_E2E }}.tar + + build-integration: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Build integration image + env: + PR_NUMBER: ${{ github.event.number }} + run: | + CRC_INTEGRATION_IMG_VERSION=pr-${PR_NUMBER} IMG_INTEGRATION=${{ env.REGISTRY}}/${{ github.repository_owner }}/${{env.IMAGE_NAME_INTEGRATION}}:${CRC_INTEGRATION_IMG_VERSION} make containerized_integration + + - name: Archive integration image + env: + PR_NUMBER: ${{ github.event.number }} + run: | + podman save -o ${{ env.IMAGE_NAME_INTEGRATION }}.tar ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{env.IMAGE_NAME_INTEGRATION}}:pr-${PR_NUMBER} + + - name: Upload integration artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.IMAGE_NAME_INTEGRATION }}-pr${{ github.event.number }} + path: ${{ env.IMAGE_NAME_INTEGRATION }}.tar