Skip to content

Commit

Permalink
add caching of maven dependencies to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbalakirev committed Jun 28, 2024
1 parent 811ba9f commit b23fdac
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -38,12 +39,21 @@ jobs:
- name: Set Test Java Runtime Environment variable
run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install dependencies
run: mvn clean install -DskipTests

test:
name: Test
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
Expand All @@ -54,6 +64,7 @@ jobs:
- "18"
- "19"
- "20"

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -72,6 +83,14 @@ jobs:
- name: Display version
run: echo "JAVA_TEST_HOME=$JAVA_TEST_HOME"

- name: Cache Maven dependencies for tests
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run test suite
run: mvn test

0 comments on commit b23fdac

Please sign in to comment.