Skip to content

Commit 9699692

Browse files
Jakub Sliacanadrianriobo
authored andcommitted
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.
1 parent f40c651 commit 9699692

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

.github/workflows/windows-e2e.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ jobs:
2727
workflow: ${{ github.event.workflow_run.workflow_id }}
2828
name: gh_context
2929

30+
- name: Download e2e image
31+
id: download-images-artifact
32+
uses: dawidd6/action-download-artifact@v2
33+
with:
34+
workflow: ${{ github.event.workflow_run.workflow_id }}
35+
name: crc-e2e-gh
36+
37+
- name: Download installer
38+
id: download-installer-artifact
39+
uses: dawidd6/action-download-artifact@v2
40+
with:
41+
workflow: ${{ github.event.workflow_run.workflow_id }}
42+
name: Windows Installer (windows-2022)
43+
3044
- name: Add correlation variables to GITHUB_ENV
3145
run: |
3246
set -xuo
@@ -56,6 +70,12 @@ jobs:
5670
https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.COMMIT_SHA }} \
5771
-d "{\"state\":\"${OUTCOME}\", \"description\":\"${DESCRIPTION}\", \"context\":\"${CONTEXT}\", \"target_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
5872
73+
- name: Write pull-secret
74+
env:
75+
PULL_SECRET: ${{ secrets.PULL_SECRET }}
76+
run: |
77+
echo $PULL_SECRET > pull-secret
78+
5979
- name: Create instance
6080
run: |
6181
# Create instance
@@ -87,13 +107,6 @@ jobs:
87107
-o ServerAliveCountMax=1200 \
88108
$(cat username)@$(cat host) "systeminfo"
89109
90-
- name: Download installer
91-
id: download-installer-artifact
92-
uses: dawidd6/action-download-artifact@v3
93-
with:
94-
workflow: ${{ github.event.workflow_run.workflow_id }}
95-
name: Windows Installer (windows-2022)
96-
97110
- name: Install CRC on host
98111
run: |
99112
# id_rsa for the host should be in pwd
@@ -121,20 +134,6 @@ jobs:
121134
# Check logs
122135
podman logs -f crc-win-support
123136
124-
- name: Write pull-secret
125-
env:
126-
PULL_SECRET: ${{ secrets.PULL_SECRET }}
127-
run: |
128-
echo $PULL_SECRET > pull-secret
129-
130-
- name: Download e2e image
131-
id: download-images-artifact
132-
uses: dawidd6/action-download-artifact@v3
133-
with:
134-
workflow_conclusion: completed
135-
workflow: build-tests.yml
136-
name: crc-e2e-gh
137-
138137
- name: Run CRC e2e
139138
run: |
140139
# load crc-e2e image from tar file

0 commit comments

Comments
 (0)