Skip to content

Commit 8e56dcf

Browse files
Merge branch 'master' of https://github.com/CatarinaGamboa/liquidjava into test_action
2 parents 1d5b130 + efbc7f1 commit 8e56dcf

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

.github/workflows/maven.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,38 @@ on:
1818

1919
jobs:
2020
build:
21-
name: Maven test on Java ${{ matrix.Java }}
21+
name: Maven test on Java ${{ matrix.java }}
2222
runs-on: ubuntu-latest
2323
env:
2424
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '15'
2525
strategy:
2626
matrix:
2727
java: ['20']
28-
steps:
29-
# - name: Workflow Telemetry
30-
# uses: runforesight/workflow-telemetry-action@v1.8.7
31-
- uses: actions/checkout@v3
32-
- name: Set up JDK 20
33-
uses: actions/setup-java@v3
34-
with:
35-
java-version: ${{ matrix.java }}
36-
distribution: 'adopt'
37-
cache: maven
38-
- name: Maven Tests
39-
run: mvn -B -X -e clean compile --file pom.xml --batch-mode --fail-fast
28+
steps:
29+
# Checkout the repository code
30+
- uses: actions/checkout@v3
31+
32+
# Set up JDK 20
33+
- name: Set up JDK 20
34+
uses: actions/setup-java@v3
35+
with:
36+
java-version: ${{ matrix.java }}
37+
distribution: 'temurin'
38+
cache: maven
39+
40+
# Cache Maven dependencies (adjust cache key to optimize)
41+
- name: Cache Maven dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: ~/.m2/repository
45+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} # Cache dependencies based on pom.xml changes
46+
restore-keys: |
47+
${{ runner.os }}-maven-
48+
49+
# Build the project (compiles and packages the code)
50+
- name: Build the project
51+
run: mvn -B -X -e clean package --file pom.xml --batch-mode --fail-fast
52+
53+
# Run tests
54+
- name: Run tests
55+
run: mvn test -B -X -e --file pom.xml --batch-mode --fail-fast

0 commit comments

Comments
 (0)