Skip to content

Commit

Permalink
Use .java_version to setup JDK in CI (#5515)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aitorvs authored Jan 23, 2025
1 parent d5ed5a5 commit 7cbb68e
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 50 deletions.
1 change: 1 addition & 0 deletions .github/.java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17
4 changes: 2 additions & 2 deletions .github/workflows/ads-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-ad-hoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-debug-apk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-fdroid-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI Checks

on:
workflow_dispatch:
push:
branches:
- main
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/custom-tabs-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-nightly-autofill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/end-to-end-robintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/external-css-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/external-ref-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/privacy-dashboard-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/privacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_upload_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-critical-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cbb68e

Please sign in to comment.