Skip to content

Commit

Permalink
Update actions in GitHub Actions workflows (#382)
Browse files Browse the repository at this point in the history
* Update actions in GitHub Actions workflows

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`

* Regenerate the Gradle Wrapper jar

* Enable `fetch-tags` in `unit-tests.yml`

* Fetch the full Git history
  • Loading branch information
MGaetan89 authored Sep 24, 2024
1 parent 9a30358 commit 4554a58
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 183 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@ 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
with:
fetch-depth: 0
- 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
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
13 changes: 7 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Thu May 13 13:17:55 BST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 4554a58

Please sign in to comment.