Cache Maven dependencies in GitHub Actions
[Mograsim.git] / .github / workflows / maven.yml
1 name: Java CI
2
3 on: [push]
4
5 jobs:
6   build:
7
8     runs-on: ubuntu-latest
9
10     steps:
11     - uses: actions/checkout@v2
12     - name: Checkout submodules # See https://github.com/actions/checkout#Checkout-submodules
13       shell: bash
14       run: |
15          auth_header="$(git config --local --get http.https://github.com/.extraheader)"
16          git submodule sync --recursive
17          git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
18     - name: Set up JDK 11
19       uses: actions/setup-java@v1
20       with:
21         java-version: 11
22     - name: Cache Maven Dependencies
23       uses: actions/cache@v2.1.1
24       with:
25         path: ~/.m2/repository
26         key: mograsim-maven-${{ hashFiles('**/pom.xml,**/MANIFEST.MF') }}
27         restore-keys: |
28           mograsim-maven-
29     - name: Build with Maven
30       run: mvn --batch-mode --errors --fail-at-end --show-version clean verify --file pom.xml