Skip to content

Commit 0035742

Browse files
I can't reliably fetch file on all OSs
1 parent bd9f445 commit 0035742

File tree

1 file changed

+68
-19
lines changed

1 file changed

+68
-19
lines changed

.github/workflows/main.yml

Lines changed: 68 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ concurrency:
88
jobs:
99
test-apk:
1010
runs-on: ubuntu-latest
11+
needs:
12+
- fetch-test-apk-old
13+
- fetch-test-apk-new
1114
name: Run diffuse action (part 1)
1215
steps:
1316
- uses: actions/checkout@v4
@@ -17,11 +20,13 @@ jobs:
1720
distribution: temurin
1821
java-version: 21
1922

20-
- name: Get old version of Android Auto app for test purposes
21-
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-old.apk" -O old-apk.apk
23+
- uses: actions/download-artifact@v4
24+
with:
25+
name: old-apk
2226

23-
- name: Get new version of Android Auto app for test purposes
24-
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-new.apk" -O new-apk.apk
27+
- uses: actions/download-artifact@v4
28+
with:
29+
name: new-apk
2530

2631
- id: diffuse
2732
uses: ./
@@ -78,6 +83,9 @@ jobs:
7883

7984
test-apk-2:
8085
runs-on: ubuntu-latest
86+
needs:
87+
- fetch-test-apk-very-old
88+
- fetch-test-apk-new
8189
name: Run diffuse action (part 2)
8290
steps:
8391
- uses: actions/checkout@v4
@@ -87,11 +95,15 @@ jobs:
8795
distribution: temurin
8896
java-version: 21
8997

90-
- name: Get very old version of Android Auto app for test purposes
91-
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-very-old.apk" -O very-old-apk.apk
98+
- uses: actions/download-artifact@v4
99+
with:
100+
name: very-old-apk
92101

93-
- name: Get new version of Android Auto app for test purposes
94-
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-new.apk" -O new-apk.apk
102+
- uses: actions/download-artifact@v4
103+
with:
104+
name: new-apk
105+
106+
- run: ls -al
95107

96108
- id: diffuse
97109
uses: ./
@@ -146,8 +158,47 @@ jobs:
146158
name: diffuse-output-2
147159
path: ${{ steps.diffuse.outputs.diff-file }}
148160

161+
fetch-test-apk-very-old:
162+
runs-on: ubuntu-latest
163+
steps:
164+
- name: Get very old version of Android Auto app for test purposes
165+
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-very-old.apk" -O very-old-apk.apk
166+
167+
- uses: actions/upload-artifact@v4
168+
with:
169+
name: very-old-apk
170+
path: very-old-apk.apk
171+
retention-days: 1
172+
173+
fetch-test-apk-old:
174+
runs-on: ubuntu-latest
175+
steps:
176+
- name: Get old version of Android Auto app for test purposes
177+
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-old.apk" -O old-apk.apk
178+
179+
- uses: actions/upload-artifact@v4
180+
with:
181+
name: old-apk
182+
path: old-apk.apk
183+
retention-days: 1
184+
185+
fetch-test-apk-new:
186+
runs-on: ubuntu-latest
187+
steps:
188+
- name: Get new version of Android Auto app for test purposes
189+
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-new.apk" -O new-apk.apk
190+
191+
- uses: actions/upload-artifact@v4
192+
with:
193+
name: new-apk
194+
path: new-apk.apk
195+
retention-days: 1
196+
149197
smoke-test:
150198
runs-on: ${{ matrix.os }}
199+
needs:
200+
- fetch-test-apk-very-old
201+
- fetch-test-apk-new
151202
strategy:
152203
fail-fast: false
153204
matrix:
@@ -160,17 +211,15 @@ jobs:
160211
distribution: temurin
161212
java-version: 21
162213

163-
- run: python3 -m pip install requests
164-
shell: bash
165-
166-
- name: Get Android Auto app APKs for test purposes
167-
run: |
168-
import requests
169-
responseOld = requests.get("https://github.com/usefulness/storage/raw/master/android-auto-very-old.apk")
170-
open("very-old-apk.apk", "wb").write(responseOld.content)
171-
responseNew = requests.get("https://github.com/usefulness/storage/raw/master/android-auto-new.apk")
172-
open("new-apk.apk", "wb").write(responseNew.content)
173-
shell: python
214+
- uses: actions/download-artifact@v4
215+
with:
216+
name: very-old-apk
217+
218+
- uses: actions/download-artifact@v4
219+
with:
220+
name: new-apk
221+
222+
- run: ls -al
174223

175224
- id: diffuse-custom-repo-hardcoded
176225
uses: ./

0 commit comments

Comments
 (0)