From d1f8ac393bd3e8645f4435c423508437c7592494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Mon, 5 Feb 2024 10:12:51 +0100 Subject: [PATCH] Update GitHub Actions dependencies (#424) --- .github/gradle-ci.properties | 1 - .github/workflows/build.yml | 46 +++++++------------ .github/workflows/build_windows.yml | 30 ++++++++++++ .github/workflows/dependency_graph.yml | 27 +++++++++++ .../workflows/gradle_wrapper_validation.yml | 19 ++++++++ .github/workflows/nightly.yml | 6 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 20 ++++---- 8 files changed, 107 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/build_windows.yml create mode 100644 .github/workflows/dependency_graph.yml create mode 100644 .github/workflows/gradle_wrapper_validation.yml diff --git a/.github/gradle-ci.properties b/.github/gradle-ci.properties index 786abbfd3..3d87884da 100644 --- a/.github/gradle-ci.properties +++ b/.github/gradle-ci.properties @@ -2,5 +2,4 @@ # Copyright (c) SRG SSR. All rights reserved. # License information is available from the LICENSE file. # -org.gradle.configuration-cache=false org.gradle.daemon=false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da45f38d2..38d233be3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,24 +13,6 @@ concurrency: cancel-in-progress: true jobs: - build-windows: - name: Build on Windows - runs-on: windows-latest - env: - USERNAME: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties - - name: Build project - run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-tv:assembleDebug - android-lint: name: Android Lint runs-on: ubuntu-latest @@ -44,8 +26,9 @@ jobs: with: java-version: '17' distribution: 'temurin' - - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Copy CI gradle.properties run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties - name: Run Android Lint @@ -69,8 +52,9 @@ jobs: with: java-version: '17' distribution: 'temurin' - - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Copy CI gradle.properties run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties - name: Run Detekt @@ -94,18 +78,20 @@ jobs: with: java-version: '17' distribution: 'temurin' - - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Copy CI gradle.properties run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties - name: Run Dependency Analysis run: ./gradlew buildHealth - name: Archive analysis report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: dependency-analysis-report path: build/reports/dependency-analysis/build-health-report.txt + overwrite: true unit-test: name: Unit Tests @@ -122,8 +108,9 @@ jobs: with: java-version: '17' distribution: 'temurin' - - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Copy CI gradle.properties run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties - name: Run Unit Tests @@ -168,8 +155,9 @@ jobs: with: java-version: '17' distribution: 'temurin' - - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Copy CI gradle.properties run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties - name: Run Android Tests diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml new file mode 100644 index 000000000..c7b5e1500 --- /dev/null +++ b/.github/workflows/build_windows.yml @@ -0,0 +1,30 @@ +name: Build on Windows + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-on-windows: + name: Build on Windows + runs-on: windows-latest + env: + USERNAME: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - name: Copy CI gradle.properties + run: mkdir -p ~/.gradle; cp .github/gradle-ci.properties ~/.gradle/gradle.properties + - name: Build project + run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-tv:assembleDebug diff --git a/.github/workflows/dependency_graph.yml b/.github/workflows/dependency_graph.yml new file mode 100644 index 000000000..423632293 --- /dev/null +++ b/.github/workflows/dependency_graph.yml @@ -0,0 +1,27 @@ +name: Submit dependency graph + +on: + push: + branches: + - main + +jobs: + submit-dependency-graph: + name: Submit dependency graph + runs-on: ubuntu-latest + permissions: + contents: write + env: + USERNAME: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - name: Submit dependency graph + uses: gradle/actions/dependency-submission@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} diff --git a/.github/workflows/gradle_wrapper_validation.yml b/.github/workflows/gradle_wrapper_validation.yml new file mode 100644 index 000000000..67fa2f6b6 --- /dev/null +++ b/.github/workflows/gradle_wrapper_validation.yml @@ -0,0 +1,19 @@ +name: Gradle Wrapper validation + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + +jobs: + gradle-wrapper-validation: + name: Gradle Wrapper validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v2 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1075cc53e..d5db1ed05 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,8 +21,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Print the last commit sha - run: echo ${{ github.sha }} - id: should_run name: Check that the last commit was made in the last 24h if: ${{ github.event_name == 'schedule' }} @@ -72,7 +70,9 @@ jobs: java-version: '17' distribution: 'temurin' - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Assemble nightly release run: ./gradlew assembleNightlyRelease - name: Upload artifact to Firebase App Distribution diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e6aba2515..2ea3535dc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 6689b85be..7101f8e46 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail