Skip to content

Commit 45316b1

Browse files
Copilottorosent
andcommitted
Simplify Java setup: remove JDK 8, use only JDK 11
- Remove JDK 8 setup since it's not needed - Remove JDK_11 environment variable workaround - Remove all `export JAVA_HOME=$JDK_11` lines - Upgrade setup-java from v2 to v4 in all jobs - Workflow now uses only JDK 11 throughout Co-authored-by: torosent <17064840+torosent@users.noreply.github.com>
1 parent 570d630 commit 45316b1

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

.github/workflows/build-validation.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,19 @@ jobs:
2222
- uses: actions/checkout@v2
2323

2424
- name: Set up JDK 11
25-
uses: actions/setup-java@v2
25+
uses: actions/setup-java@v4
2626
with:
2727
java-version: '11'
2828
distribution: 'microsoft'
2929

30-
- name: set JDK_11 environment variable test compiling and running
31-
env:
32-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
33-
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34-
35-
- name: Set up JDK 8
36-
uses: actions/setup-java@v2
37-
with:
38-
java-version: '8'
39-
distribution: 'temurin'
40-
4130
- name: Setup Gradle
4231
uses: gradle/gradle-build-action@v2
4332

4433
- name: Build with Gradle
45-
run: |
46-
export JAVA_HOME=$JDK_11
47-
./gradlew build -x test
34+
run: ./gradlew build -x test
4835

4936
- name: Run SpotBugs
50-
run: |
51-
export JAVA_HOME=$JDK_11
52-
./gradlew spotbugsMain spotbugsTest
37+
run: ./gradlew spotbugsMain spotbugsTest
5338
continue-on-error: false
5439

5540
- name: Upload SpotBugs reports
@@ -60,9 +45,7 @@ jobs:
6045
if-no-files-found: ignore
6146

6247
- name: Run Unit Tests with Gradle
63-
run: |
64-
export JAVA_HOME=$JDK_11
65-
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
48+
run: ./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
6649
continue-on-error: true
6750

6851
- name: Upload test reports if tests failed
@@ -108,9 +91,7 @@ jobs:
10891
sleep 5
10992
11093
- name: Integration Tests with Gradle
111-
run: |
112-
export JAVA_HOME=$JDK_11
113-
./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
94+
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
11495
continue-on-error: true
11596

11697
- name: Kill Durable Task Emulator
@@ -147,7 +128,7 @@ jobs:
147128
- uses: actions/checkout@v2
148129

149130
- name: Set up JDK 11
150-
uses: actions/setup-java@v2
131+
uses: actions/setup-java@v4
151132
with:
152133
java-version: '11'
153134
distribution: 'microsoft'
@@ -186,7 +167,7 @@ jobs:
186167
- uses: actions/checkout@v2
187168

188169
- name: Set up JDK 11
189-
uses: actions/setup-java@v2
170+
uses: actions/setup-java@v4
190171
with:
191172
java-version: '11'
192173
distribution: 'microsoft'

0 commit comments

Comments
 (0)