Try new version of cache #210
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-on-push | |
on: [push] | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 11 | |
- name: "Cache local Maven" | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Execute tests and compute coverage | |
run: mvn clean test | |
- name: Generate coverage report | |
run: mvn jacoco:report | |
publish-job: | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 11 | |
- run: mvn -B package --file pom.xml -DskipTests | |
- run: mkdir staging && cp **/target/*jar-with-dependencies.jar staging | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: Package | |
path: staging |