Created
January 11, 2023 23:28
-
-
Save dehidehidehi/a8621c5de03b61a683dd23963295be9a to your computer and use it in GitHub Desktop.
Github workflow: execute Maven tests with pom.xml cached-dependencies (.github/workflows/main.yml)
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: 'Test PRs' | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '19' | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Maven test | |
run: mvn test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment