Skip to content

Commit 85a1156

Browse files
authored
Fix GitHub actions (XRPLF#583 and XRPLF#597)
Fixes XRPLF#583 and XRPLF#599 by updating the following: Update to actions/checkout@v4 which remove the need for actions/cache. Update to actions/setup-java@v4 Update to temurin as the primary distribution for the actions/setup-java action. Update deprected ubuntu-20.04 to ubuntu-latest per this. NOTE this announcement that describes how actions/cache will gradually fail through 2/18/2025 to prod project updates.
1 parent 496221a commit 85a1156

File tree

1 file changed

+91
-99
lines changed

1 file changed

+91
-99
lines changed

.github/workflows/workflow.yml

+91-99
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
name: xrpl4j-CI
22

3-
43
on:
54
push:
65
pull_request:
7-
types: [assigned]
6+
types: [ assigned ]
87
jobs:
9-
build_java8:
10-
runs-on: ubuntu-20.04
8+
build_jdk_temurin_8:
9+
runs-on: ubuntu-latest
1110
steps:
1211
# Checks-out the repository under $GITHUB_WORKSPACE
13-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1413
# Set up Java 8
15-
- name: Set up JDK 1.8
16-
uses: actions/setup-java@v1
17-
with:
18-
java-version: 1.8
19-
- name: Cache mvn dependencies
20-
uses: actions/cache@v4
21-
env:
22-
cache-name: mvn-deps
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v4
2316
with:
24-
path: ~/.m2
25-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
26-
restore-keys: ${{ env.cache-name }}-
17+
distribution: 'temurin'
18+
java-version: '8'
19+
cache: 'maven'
2720
- name: Build
2821
run: mvn dependency:go-offline install
2922
- name: Upload to Codecov
@@ -32,130 +25,129 @@ jobs:
3225
token: ${{ secrets.CODECOV_TOKEN }}
3326
fail_ci_if_error: true
3427

35-
build_android:
36-
runs-on: ubuntu-20.04
28+
build_jdk_semeru_8:
29+
runs-on: ubuntu-latest
3730
steps:
3831
# Checks-out the repository under $GITHUB_WORKSPACE
39-
- uses: actions/checkout@v2
40-
# Set up Android
41-
- name: Setup Android SDK
42-
uses: android-actions/setup-android@v2
43-
- name: Cache mvn dependencies
44-
uses: actions/cache@v4
45-
env:
46-
cache-name: mvn-deps
32+
- uses: actions/checkout@v4
33+
# Set up Java 8
34+
- name: Set up JDK 8
35+
uses: actions/setup-java@v4
4736
with:
48-
path: ~/.m2
49-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
50-
restore-keys: ${{ env.cache-name }}-
37+
distribution: 'semeru'
38+
java-version: '8'
39+
cache: 'maven'
5140
- name: Build
52-
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true -Pandroid
41+
run: mvn dependency:go-offline install
42+
43+
build_jdk_zulu_8:
44+
runs-on: ubuntu-latest
45+
steps:
46+
# Checks-out the repository under $GITHUB_WORKSPACE
47+
- uses: actions/checkout@v4
48+
# Set up Java 8
49+
- name: Set up JDK 8
50+
uses: actions/setup-java@v4
51+
with:
52+
distribution: 'zulu'
53+
java-version: '8'
54+
cache: 'maven'
55+
- name: Build
56+
run: mvn dependency:go-offline install
5357

54-
build_other_java:
55-
runs-on: ubuntu-20.04
58+
build_jdk_temurin_other:
59+
runs-on: ubuntu-latest
5660
strategy:
5761
matrix:
58-
# test against each major Java version
59-
java: [ 9, 10, 11, 12, 13, 14, 15, 16, 17 ]
62+
# test against each major Java version (Java 8 built separately above for codecov upload)
63+
java: [ 11, 16, 17, 21 ]
6064
steps:
6165
# Checks-out the repository under $GITHUB_WORKSPACE
62-
- uses: actions/checkout@v2
66+
- uses: actions/checkout@v4
6367
# Set up Java version
6468
- name: Set up JDK ${{ matrix.java }}
65-
uses: actions/setup-java@v1
69+
uses: actions/setup-java@v4
6670
with:
71+
distribution: 'temurin'
6772
java-version: ${{ matrix.java }}
68-
- name: Cache mvn dependencies
69-
uses: actions/cache@v4
70-
env:
71-
cache-name: mvn-deps
72-
with:
73-
path: ~/.m2
74-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
75-
restore-keys: ${{ env.cache-name }}-
73+
cache: 'maven'
7674
- name: Build
7775
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true
7876

79-
build_open_jdk_non_us:
80-
runs-on: ubuntu-20.04
77+
build_jdk_temurin_non_us:
78+
runs-on: ubuntu-latest
8179
steps:
82-
- uses: actions/checkout@v2
83-
# Set up Adopt OpenJDK Hotspot 16
84-
- name: Set up OpenJDK 16
85-
uses: actions/setup-java@v1
86-
with:
87-
distribution: adopt
88-
java-version: 16
89-
- name: Cache mvn dependencies
90-
uses: actions/cache@v4
91-
env:
92-
cache-name: mvn-deps
80+
- uses: actions/checkout@v4
81+
# Set up Temurin 21
82+
- name: Set up Temurin v21
83+
uses: actions/setup-java@v4
9384
with:
94-
path: ~/.m2
95-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
96-
restore-keys: ${{ env.cache-name }}-
85+
distribution: 'temurin'
86+
java-version: 21
87+
cache: 'maven'
9788
# Maven install with JVM locale = de_DE
9889
- name: Build
9990
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true -DargLine="-Duser.language=de -Duser.country=DE"
10091

92+
build_android:
93+
runs-on: ubuntu-latest
94+
steps:
95+
# Checks-out the repository under $GITHUB_WORKSPACE
96+
- uses: actions/checkout@v4
97+
# Set up Java 17
98+
- name: Set up JDK 21
99+
uses: actions/setup-java@v4
100+
with:
101+
distribution: 'temurin'
102+
java-version: '21'
103+
cache: 'maven'
104+
# Set up Android
105+
- name: Setup Android SDK
106+
uses: android-actions/setup-android@v3
107+
- name: Build
108+
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true -Pandroid
109+
101110
build_devnet_its:
102-
runs-on: ubuntu-20.04
111+
runs-on: ubuntu-latest
103112
steps:
104113
# Checks-out the repository under $GITHUB_WORKSPACE
105-
- uses: actions/checkout@v2
114+
- uses: actions/checkout@v4
106115
# Set up Java 8
107-
- name: Set up JDK 1.8
108-
uses: actions/setup-java@v1
109-
with:
110-
java-version: 1.8
111-
- name: Cache mvn dependencies
112-
uses: actions/cache@v4
113-
env:
114-
cache-name: mvn-deps
116+
- name: Set up JDK 8
117+
uses: actions/setup-java@v4
115118
with:
116-
path: ~/.m2
117-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
118-
restore-keys: ${{ env.cache-name }}-
119+
distribution: 'temurin'
120+
java-version: '8'
121+
cache: 'maven'
119122
- name: Build
120123
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true -DuseDevnet
121124

122125
build_testnet_reporting_its:
123-
runs-on: ubuntu-20.04
126+
runs-on: ubuntu-latest
124127
steps:
125128
# Checks-out the repository under $GITHUB_WORKSPACE
126-
- uses: actions/checkout@v2
129+
- uses: actions/checkout@v4
127130
# Set up Java 8
128-
- name: Set up JDK 1.8
129-
uses: actions/setup-java@v1
131+
- name: Set up JDK 8
132+
uses: actions/setup-java@v4
130133
with:
131-
java-version: 1.8
132-
- name: Cache mvn dependencies
133-
uses: actions/cache@v4
134-
env:
135-
cache-name: mvn-deps
136-
with:
137-
path: ~/.m2
138-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
139-
restore-keys: ${{ env.cache-name }}-
134+
distribution: 'temurin'
135+
java-version: '8'
136+
cache: 'maven' # setup-java v4 includes maven caching
140137
- name: Build
141138
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true -DuseTestnet
139+
142140
build_testnet_clio_its:
143-
runs-on: ubuntu-20.04
141+
runs-on: ubuntu-latest
144142
steps:
145143
# Checks-out the repository under $GITHUB_WORKSPACE
146-
- uses: actions/checkout@v2
144+
- uses: actions/checkout@v4
147145
# Set up Java 8
148-
- name: Set up JDK 1.8
149-
uses: actions/setup-java@v1
150-
with:
151-
java-version: 1.8
152-
- name: Cache mvn dependencies
153-
uses: actions/cache@v4
154-
env:
155-
cache-name: mvn-deps
146+
- name: Set up JDK 8
147+
uses: actions/setup-java@v4
156148
with:
157-
path: ~/.m2
158-
key: ${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
159-
restore-keys: ${{ env.cache-name }}-
149+
distribution: 'temurin'
150+
java-version: '8'
151+
cache: 'maven'
160152
- name: Build
161153
run: mvn dependency:go-offline install -Dmaven.javadoc.skip=true -DuseClioTestnet -DuseClioMainnet

0 commit comments

Comments
 (0)