From 500f69ff46807b3cd0e84c3e1b67f7f14e652081 Mon Sep 17 00:00:00 2001 From: Jakub Sliacan Date: Fri, 26 Jan 2024 11:10:57 +0100 Subject: [PATCH] gha: rearrange steps to avoid provisioning unnecessarily Move all steps that might fail to before the provisioning step to avoid creating a machine if simple steps needed to run tests on it fail anyways. --- .github/workflows/windows-e2e.yml | 41 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/windows-e2e.yml b/.github/workflows/windows-e2e.yml index 1de76f62ea..0d9a0332fc 100644 --- a/.github/workflows/windows-e2e.yml +++ b/.github/workflows/windows-e2e.yml @@ -27,6 +27,20 @@ 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 @@ -56,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 @@ -87,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 @@ -121,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-gh - - name: Run CRC e2e run: | # load crc-e2e image from tar file