From 05b75c55c786043adc6ba5ee9f08d2c140d85c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwieci=C5=84ski?= <36954793+mateuszkwiecinski@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:49:13 +0200 Subject: [PATCH 1/3] Run on `ubuntu-24.04` --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9a8135..4454b15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -151,7 +151,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [ ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04 ] steps: - uses: actions/checkout@v4 From bae5ca2506837201bb82e0a8447b37269741106d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Thu, 6 Jun 2024 16:09:33 +0200 Subject: [PATCH 2/3] I can't reliably fetch file on all OSs --- .github/workflows/main.yml | 83 +++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4454b15..50d5f65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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: ./ @@ -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 @@ -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: ./ @@ -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: @@ -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: ./ From 146735b0ed691ecf7cd7668b8369ed205d4288e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Thu, 6 Jun 2024 16:31:52 +0200 Subject: [PATCH 3/3] Use venv --- action.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index f96aef4..bd5c239 100644 --- a/action.yml +++ b/action.yml @@ -89,9 +89,6 @@ branding: runs: using: 'composite' steps: - - run: python3 -m pip install requests - shell: bash - - id: run-diffuse env: INPUT_OLD_FILE: ${{ inputs.old-file-path }} @@ -102,5 +99,13 @@ runs: INPUT_DIFFUSE_REPO: ${{ inputs.diffuse-repo }} INPUT_DEBUG: ${{ inputs.debug }} INPUT_GITHUB_TOKEN: ${{ github.token }} - run: python3 "$GITHUB_ACTION_PATH"/entrypoint.py + run: | + python3 -m venv "$GITHUB_ACTION_PATH"/diffuse-venv + if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then + source "$GITHUB_ACTION_PATH"/diffuse-venv/Scripts/activate + else + source "$GITHUB_ACTION_PATH"/diffuse-venv/bin/activate + fi + python3 -m pip install requests + python3 "$GITHUB_ACTION_PATH"/entrypoint.py shell: bash