From e214e92564007dea854ca77a30bab59d71f492b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Tue, 24 Sep 2024 15:32:13 +0200 Subject: [PATCH] Update actions in GitHub Actions workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR updates the various actions used in the existing GitHub Actions workflows. - `ubuntu-18.04` → `ubuntu-latest` - `actions/checkout@v1` → `v4` - `actions/checkout@v2` → `v4` - `actions/setup-java@v1` → `v4` - `eskatos/gradle-command-action@v1` → `gradle/actions/setup-gradle@v4` - `actions/upload-artifact@v1` → `v4` --- .github/workflows/build.yml | 25 +++++++++++------------ .github/workflows/unit-tests.yml | 35 +++++++++++++++----------------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32de4753..8eabc8d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,34 +15,33 @@ jobs: name: Build and release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: token: "${{ secrets.GITHUB_TOKEN }}" fetch-depth: 0 - - name: set up JDK 17 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'temurin' - name: Get latest version run: | echo $(git describe --tags --abbrev=0) echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Build bundle - uses: eskatos/gradle-command-action@v1 - with: - arguments: ':app:bundlePurefossDebug' - - name: Build apk - uses: eskatos/gradle-command-action@v1 - with: - arguments: ':app:assemblePurefossDebug' - - name: Upload apk and bundle - uses: actions/upload-artifact@v1 + run: ./gradlew :app:bundlePurefossDebug + - name: Build APK + run: ./gradlew :app:assemblePurefossDebug + - name: Upload APK and bundle + uses: actions/upload-artifact@v4 with: name: app path: app/build/outputs/ - name: Create release if: startsWith(github.ref, 'refs/tags/') - uses: "marvinpinto/action-automatic-releases@latest" + uses: marvinpinto/action-automatic-releases@latest with: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index e07007fa..247083f6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -11,23 +11,20 @@ on: jobs: test: name: Run Unit Tests - runs-on: ubuntu-18.04 - + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Unit tests - run: bash ./gradlew testPurefossDebug -PdisablePreDex --no-daemon - - name: Archive test results - uses: actions/upload-artifact@v1 - with: - name: test-results - path: app/build/test-results/testPurefossDebugUnitTest/ - - name: Archive test reports - uses: actions/upload-artifact@v1 - with: - name: test-reports - path: app/build/reports/tests + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'temurin' + - name: Unit tests + run: ./gradlew testPurefossDebug -PdisablePreDex --no-daemon + - name: Archive test results + uses: actions/upload-artifact@v4 + with: + name: test-results + path: | + app/build/test-results/testPurefossDebugUnitTest/ + app/build/reports/tests