Skip to content

Commit

Permalink
I can't reliably fetch file on all OSs
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed Jun 6, 2024
1 parent 05b75c5 commit bae5ca2
Showing 1 changed file with 64 additions and 19 deletions.
83 changes: 64 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ concurrency:
jobs:
test-apk:
runs-on: ubuntu-latest
needs:
- fetch-test-apk-old
- fetch-test-apk-new
name: Run diffuse action (part 1)
steps:
- uses: actions/checkout@v4
Expand All @@ -17,11 +20,13 @@ jobs:
distribution: temurin
java-version: 21

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

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

- id: diffuse
uses: ./
Expand Down Expand Up @@ -78,6 +83,9 @@ jobs:

test-apk-2:
runs-on: ubuntu-latest
needs:
- fetch-test-apk-very-old
- fetch-test-apk-new
name: Run diffuse action (part 2)
steps:
- uses: actions/checkout@v4
Expand All @@ -87,11 +95,13 @@ jobs:
distribution: temurin
java-version: 21

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

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

- id: diffuse
uses: ./
Expand Down Expand Up @@ -146,8 +156,47 @@ jobs:
name: diffuse-output-2
path: ${{ steps.diffuse.outputs.diff-file }}

fetch-test-apk-very-old:
runs-on: ubuntu-latest
steps:
- name: Get very old version of Android Auto app for test purposes
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-very-old.apk" -O very-old-apk.apk

- uses: actions/upload-artifact@v4
with:
name: very-old-apk
path: very-old-apk.apk
retention-days: 1

fetch-test-apk-old:
runs-on: ubuntu-latest
steps:
- name: Get old version of Android Auto app for test purposes
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-old.apk" -O old-apk.apk

- uses: actions/upload-artifact@v4
with:
name: old-apk
path: old-apk.apk
retention-days: 1

fetch-test-apk-new:
runs-on: ubuntu-latest
steps:
- name: Get new version of Android Auto app for test purposes
run: wget "https://github.com/usefulness/storage/raw/master/android-auto-new.apk" -O new-apk.apk

- uses: actions/upload-artifact@v4
with:
name: new-apk
path: new-apk.apk
retention-days: 1

smoke-test:
runs-on: ${{ matrix.os }}
needs:
- fetch-test-apk-very-old
- fetch-test-apk-new
strategy:
fail-fast: false
matrix:
Expand All @@ -160,17 +209,13 @@ jobs:
distribution: temurin
java-version: 21

- run: python3 -m pip install requests
shell: bash

- name: Get Android Auto app APKs for test purposes
run: |
import requests
responseOld = requests.get("https://github.com/usefulness/storage/raw/master/android-auto-very-old.apk")
open("very-old-apk.apk", "wb").write(responseOld.content)
responseNew = requests.get("https://github.com/usefulness/storage/raw/master/android-auto-new.apk")
open("new-apk.apk", "wb").write(responseNew.content)
shell: python
- uses: actions/download-artifact@v4
with:
name: very-old-apk

- uses: actions/download-artifact@v4
with:
name: new-apk

- id: diffuse-custom-repo-hardcoded
uses: ./
Expand Down

0 comments on commit bae5ca2

Please sign in to comment.