diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml deleted file mode 100644 index a40c8a0942..0000000000 --- a/.github/workflows/build-tests.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build test images -on: - push: - branches: - - "main" - pull_request: {} - -env: - 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@v4 - - - name: Build and archive e2e image - # use github.sha as ID to correlate various workflows triggered by the same event - run: | - CRC_E2E_IMG_VERSION=id-${{ github.sha }} make containerized_e2e - podman save -o ${{ env.IMAGE_NAME_E2E }}.tar quay.io/crcont/${{ env.IMAGE_NAME_E2E}}:id-${{ github.sha }} - - - name: Upload e2e image - uses: actions/upload-artifact@v4 - with: - name: ${{ env.IMAGE_NAME_E2E }}-id${{ github.sha }} - 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@v4 - - - name: Build and archive integration image - # use github.sha as ID to correlate various workflows triggered by the same event - run: | - CRC_INTEGRATION_IMG_VERSION=id-${{ github.sha }} make containerized_integration - podman save -o ${{ env.IMAGE_NAME_INTEGRATION }}.tar quay.io/crcont/${{ env.IMAGE_NAME_INTEGRATION }}:id-${{ github.sha }} - - - name: Upload integration image - uses: actions/upload-artifact@v4 - with: - name: ${{ env.IMAGE_NAME_INTEGRATION }}-id${{ github.sha }} - path: ${{ env.IMAGE_NAME_INTEGRATION }}.tar \ No newline at end of file diff --git a/.github/workflows/windows-artifacts.yml b/.github/workflows/windows-artifacts.yml new file mode 100644 index 0000000000..424d4ad92a --- /dev/null +++ b/.github/workflows/windows-artifacts.yml @@ -0,0 +1,99 @@ +name: Build Windows artifacts +on: + push: + branches: + - "main" + pull_request: {} + +env: + IMAGE_NAME_E2E: crc-e2e + IMAGE_NAME_INTEGRATION: crc-integration + +jobs: + build-installer: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - windows-2022 + go: + - '1.20' + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + - name: Set path for heat.exe and light.exe + run: echo "$WIX\\bin" >>$GITHUB_PATH + shell: bash + - name: Build Windows installer + run: make out/windows-amd64/crc-windows-installer.zip + - name: Upload windows installer artifact + uses: actions/upload-artifact@v3 + with: + name: Windows Installer (${{ matrix.os }}) + path: "./out/windows-amd64/crc-windows-installer.zip" + + build-e2e: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Build and archive e2e image + # use github.sha as ID to correlate various workflows triggered by the same event + run: | + CRC_E2E_IMG_VERSION=gh make containerized_e2e + podman save -o ${{ env.IMAGE_NAME_E2E }}.tar quay.io/crcont/${{ env.IMAGE_NAME_E2E}}:gh + + - name: Upload e2e image + uses: actions/upload-artifact@v3 + with: + name: ${{ env.IMAGE_NAME_E2E }}-gh + 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 and archive integration image + # use github.sha as ID to correlate various workflows triggered by the same event + run: | + CRC_INTEGRATION_IMG_VERSION=gh make containerized_integration + podman save -o ${{ env.IMAGE_NAME_INTEGRATION }}.tar quay.io/crcont/${{ env.IMAGE_NAME_INTEGRATION }}:gh + + - name: Upload integration image + uses: actions/upload-artifact@v3 + with: + name: ${{ env.IMAGE_NAME_INTEGRATION }}-gh + path: ${{ env.IMAGE_NAME_INTEGRATION }}.tar + + save-gh-context: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + + - name: Save the GH context in an artifact + shell: bash + env: + GH_CONTEXT: ${{ toJSON(github) }} + run: echo $GH_CONTEXT > gh_context.json + + - name: Upload the GH context artifact + uses: actions/upload-artifact@v3 + with: + name: gh_context + path: ./gh_context.json diff --git a/.github/workflows/windows-e2e.yml b/.github/workflows/windows-e2e.yml index 4be3a52987..0d9a0332fc 100644 --- a/.github/workflows/windows-e2e.yml +++ b/.github/workflows/windows-e2e.yml @@ -2,7 +2,7 @@ name: Windows e2e on: workflow_run: - workflows: [Build Windows installer] + workflows: [Build Windows artifacts] types: - completed @@ -27,13 +27,24 @@ jobs: workflow: ${{ github.event.workflow_run.workflow_id }} name: gh_context + - name: Download e2e image + id: download-images-artifact + uses: dawidd6/action-download-artifact@v2 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + name: crc-e2e-gh + + - name: Download installer + id: download-installer-artifact + uses: dawidd6/action-download-artifact@v2 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + name: Windows Installer (windows-2022) + - name: Add correlation variables to GITHUB_ENV run: | set -xuo - # SHA used as ID to correlate artifacts between buld-tests, windows-installer, and windows-e2e workflows - echo "SHA=$(cat gh_context.json | jq -r '.sha')" >> "$GITHUB_ENV" - COMMIT_ID=$(cat gh_context.json | jq -r '.event.after') # if this is a new PR, .event.after is empty, use .sha instead in that case if [[ -z "$COMMIT_ID" ]]; then @@ -49,7 +60,7 @@ jobs: OUTCOME="pending" DESCRIPTION="Running e2e on Windows" - CONTEXT="win-ci-e2e" + CONTEXT="ci/gh/e2e/windows-${{ matrix.windows-version }}-${{ matrix.windows-featurepack }}" # post result to commit status curl -L -v \ @@ -59,6 +70,12 @@ jobs: https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.COMMIT_SHA }} \ -d "{\"state\":\"${OUTCOME}\", \"description\":\"${DESCRIPTION}\", \"context\":\"${CONTEXT}\", \"target_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}" + - name: Write pull-secret + env: + PULL_SECRET: ${{ secrets.PULL_SECRET }} + run: | + echo $PULL_SECRET > pull-secret + - name: Create instance run: | # Create instance @@ -90,13 +107,6 @@ jobs: -o ServerAliveCountMax=1200 \ $(cat username)@$(cat host) "systeminfo" - - name: Download installer - id: download-installer-artifact - uses: dawidd6/action-download-artifact@v3 - with: - workflow: ${{ github.event.workflow_run.workflow_id }} - name: Windows Installer (windows-2022) - - name: Install CRC on host run: | # id_rsa for the host should be in pwd @@ -124,20 +134,6 @@ jobs: # Check logs podman logs -f crc-win-support - - name: Write pull-secret - env: - PULL_SECRET: ${{ secrets.PULL_SECRET }} - run: | - echo $PULL_SECRET > pull-secret - - - name: Download e2e image - id: download-images-artifact - uses: dawidd6/action-download-artifact@v3 - with: - workflow_conclusion: completed - workflow: build-tests.yml - name: crc-e2e-id${{ env.SHA }} - - name: Run CRC e2e run: | # load crc-e2e image from tar file @@ -163,7 +159,7 @@ jobs: -v $PWD/pull-secret:/opt/crc/pull-secret:Z \ -v $PWD/output:/output:Z \ -v $PWD/id_rsa:/opt/crc/id_rsa:Z \ - quay.io/crcont/crc-e2e:id-${{ env.SHA }} \ + quay.io/crcont/crc-e2e:gh \ -targetFolder ${TARGET_FOLDER} \ -junitResultsPath ${TARGET_FOLDER}/junit @@ -200,8 +196,8 @@ jobs: OUTCOME="failure"; fi - DESCRIPTION="Finished e2e on Windows" - CONTEXT="win-ci-e2e" + DESCRIPTION="Finished" + CONTEXT="ci/gh/e2e/windows-${{ matrix.windows-version }}-${{ matrix.windows-featurepack }}" # post result to commit status curl -L -v \ @@ -229,4 +225,4 @@ jobs: --project-name 'windows-desktop' \ --backed-url 'file:///workspace' # Check logs - podman logs -f windows-destroy \ No newline at end of file + podman logs -f windows-destroy diff --git a/.github/workflows/windows-installer.yml b/.github/workflows/windows-installer.yml deleted file mode 100644 index dea7ce0d67..0000000000 --- a/.github/workflows/windows-installer.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build Windows installer -on: - push: - branches: - - "main" - pull_request: {} - -jobs: - save-gh-context: - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - - name: Save the GH context in an artifact - shell: bash - env: - GH_CONTEXT: ${{ toJSON(github) }} - run: echo $GH_CONTEXT > gh_context.json - - - name: Upload the GH context artifact - uses: actions/upload-artifact@v4 - with: - name: gh_context - path: ./gh_context.json - - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - windows-2022 - go: - - '1.20' - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go }} - - name: Set path for heat.exe and light.exe - run: echo "$WIX\\bin" >>$GITHUB_PATH - shell: bash - - name: Build Windows installer - run: make out/windows-amd64/crc-windows-installer.zip - - name: Upload windows installer artifact - uses: actions/upload-artifact@v4 - with: - name: Windows Installer (${{ matrix.os }}) - path: "./out/windows-amd64/crc-windows-installer.zip"