Skip to content

Commit

Permalink
gha: rearrange steps to avoid provisioning unnecessarily
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jsliacan committed Jan 31, 2024
1 parent 0ebde76 commit c90f992
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/windows-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c90f992

Please sign in to comment.