name: Build

on: [ push, pull_request, workflow_dispatch ]

jobs:
  build:
    runs-on: ubuntu-latest

    env:
      MAVEN_OPTS: -Xmx1024M

    steps:
      - uses: actions/checkout@v3
        with:
          path: Vitro

      - name: Maven Cache
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-cache-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-cache-m2-

      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 11

      - name: Maven Build
        run: |
          cd ./Vitro
          mvn clean install
