From 7cbb68ef9cc8e0845b38a8eb8fb3ebb9eb22eb5b Mon Sep 17 00:00:00 2001 From: Aitor Viana Date: Thu, 23 Jan 2025 19:11:11 +0000 Subject: [PATCH] Use .java_version to setup JDK in CI (#5515) Task/Issue URL: https://app.asana.com/0/488551667048375/1209216610352826/f ### Description Use `.java-version` file to centralise JDK updates across all GH workflows ### Steps to test this PR CI shall pass --- .github/.java-version | 1 + .github/workflows/ads-end-to-end.yml | 4 ++-- .github/workflows/build-ad-hoc.yml | 4 ++-- .github/workflows/build-debug-apk.yaml | 4 ++-- .github/workflows/build-fdroid-apk.yml | 4 ++-- .github/workflows/ci.yml | 17 +++++++++-------- .github/workflows/custom-tabs-nightly.yml | 4 ++-- .github/workflows/docs.yml | 4 ++-- .github/workflows/e2e-nightly-autofill.yml | 4 ++-- .github/workflows/end-to-end-robintest.yml | 4 ++-- .github/workflows/external-css-tests.yml | 4 ++-- .github/workflows/external-ref-tests.yml | 8 ++++---- .github/workflows/nightly.yml | 16 ++++++++-------- .../workflows/privacy-dashboard-end-to-end.yml | 4 ++-- .github/workflows/privacy.yml | 4 ++-- .github/workflows/release_nightly.yml | 4 ++-- .github/workflows/release_tests.yml | 4 ++-- .github/workflows/release_upload_play_store.yml | 4 ++-- .github/workflows/sync-critical-path.yml | 4 ++-- 19 files changed, 52 insertions(+), 50 deletions(-) create mode 100644 .github/.java-version diff --git a/.github/.java-version b/.github/.java-version new file mode 100644 index 000000000000..8e2afd342773 --- /dev/null +++ b/.github/.java-version @@ -0,0 +1 @@ +17 \ No newline at end of file diff --git a/.github/workflows/ads-end-to-end.yml b/.github/workflows/ads-end-to-end.yml index 027264dd755d..6c657302e3b9 100644 --- a/.github/workflows/ads-end-to-end.yml +++ b/.github/workflows/ads-end-to-end.yml @@ -20,10 +20,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/build-ad-hoc.yml b/.github/workflows/build-ad-hoc.yml index 605469018fe3..1d2f3d661dd0 100644 --- a/.github/workflows/build-ad-hoc.yml +++ b/.github/workflows/build-ad-hoc.yml @@ -36,10 +36,10 @@ jobs: submodules: recursive token: ${{ secrets.GT_DAXMOBILE }} ref: ${{ github.event.inputs.app-version }} - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/build-debug-apk.yaml b/.github/workflows/build-debug-apk.yaml index aff7138b1011..1ff662bb060d 100644 --- a/.github/workflows/build-debug-apk.yaml +++ b/.github/workflows/build-debug-apk.yaml @@ -23,10 +23,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up Go diff --git a/.github/workflows/build-fdroid-apk.yml b/.github/workflows/build-fdroid-apk.yml index dbbe32ab0d4a..b5bd6859a2ff 100644 --- a/.github/workflows/build-fdroid-apk.yml +++ b/.github/workflows/build-fdroid-apk.yml @@ -27,10 +27,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e8c7ddae855..c85cdf8838ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI Checks on: + workflow_dispatch: push: branches: - main @@ -28,10 +29,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle @@ -50,10 +51,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle @@ -83,10 +84,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up Go @@ -126,10 +127,10 @@ jobs: with: force: true - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up Go diff --git a/.github/workflows/custom-tabs-nightly.yml b/.github/workflows/custom-tabs-nightly.yml index 007bbd867175..f41c57c2d8bb 100644 --- a/.github/workflows/custom-tabs-nightly.yml +++ b/.github/workflows/custom-tabs-nightly.yml @@ -20,10 +20,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 65d99312f180..ebd3eaea1637 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,10 +31,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle diff --git a/.github/workflows/e2e-nightly-autofill.yml b/.github/workflows/e2e-nightly-autofill.yml index 0884763bfc7f..319ca368918e 100644 --- a/.github/workflows/e2e-nightly-autofill.yml +++ b/.github/workflows/e2e-nightly-autofill.yml @@ -20,10 +20,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/end-to-end-robintest.yml b/.github/workflows/end-to-end-robintest.yml index 94ef3e5ed6a9..24a86e521b28 100644 --- a/.github/workflows/end-to-end-robintest.yml +++ b/.github/workflows/end-to-end-robintest.yml @@ -20,10 +20,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/external-css-tests.yml b/.github/workflows/external-css-tests.yml index 3d9f10a206ea..318e48284f73 100644 --- a/.github/workflows/external-css-tests.yml +++ b/.github/workflows/external-css-tests.yml @@ -40,10 +40,10 @@ jobs: working-directory: node_modules/@duckduckgo/content-scope-scripts run: npm run build - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Decode secret diff --git a/.github/workflows/external-ref-tests.yml b/.github/workflows/external-ref-tests.yml index 2d38e8e15faf..1e2eecc82cea 100644 --- a/.github/workflows/external-ref-tests.yml +++ b/.github/workflows/external-ref-tests.yml @@ -33,10 +33,10 @@ jobs: - name: Copy files run: copy-files-from-to - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle @@ -80,10 +80,10 @@ jobs: - name: Copy files run: copy-files-from-to - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Decode secret diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cdc7c1f49eeb..de53c099bc27 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -20,10 +20,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle @@ -42,10 +42,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Setup Gradle @@ -75,10 +75,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up Go @@ -118,10 +118,10 @@ jobs: with: force: true - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up Go diff --git a/.github/workflows/privacy-dashboard-end-to-end.yml b/.github/workflows/privacy-dashboard-end-to-end.yml index 7a067514d418..23d4e5c90728 100644 --- a/.github/workflows/privacy-dashboard-end-to-end.yml +++ b/.github/workflows/privacy-dashboard-end-to-end.yml @@ -23,10 +23,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/privacy.yml b/.github/workflows/privacy.yml index 8dcff92f4068..4e49d5b65ba0 100644 --- a/.github/workflows/privacy.yml +++ b/.github/workflows/privacy.yml @@ -28,10 +28,10 @@ jobs: with: force: true - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up Go diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 22b86683c5e6..ee85f925b288 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -23,10 +23,10 @@ jobs: token: ${{ secrets.GT_DAXMOBILE }} fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up ruby env diff --git a/.github/workflows/release_tests.yml b/.github/workflows/release_tests.yml index 2722d99376b3..36f890ddd34e 100644 --- a/.github/workflows/release_tests.yml +++ b/.github/workflows/release_tests.yml @@ -27,10 +27,10 @@ jobs: submodules: recursive ref: ${{ github.event.inputs.app-version }} - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create folder diff --git a/.github/workflows/release_upload_play_store.yml b/.github/workflows/release_upload_play_store.yml index eadb50330c5f..5edd925074ba 100644 --- a/.github/workflows/release_upload_play_store.yml +++ b/.github/workflows/release_upload_play_store.yml @@ -29,10 +29,10 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Set up ruby env diff --git a/.github/workflows/sync-critical-path.yml b/.github/workflows/sync-critical-path.yml index 589c43a810bd..fe50b819753b 100644 --- a/.github/workflows/sync-critical-path.yml +++ b/.github/workflows/sync-critical-path.yml @@ -20,10 +20,10 @@ jobs: with: submodules: recursive - - name: Set up JDK 17 + - name: Set up JDK version uses: actions/setup-java@v4 with: - java-version: '17' + java-version-file: .github/.java-version distribution: 'adopt' - name: Create test account for Sync and return the recovery code