name: CI

on: [ push, pull_request ]

jobs:
  build:
    runs-on: ubuntu-20.04

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Cache
        uses: actions/cache@v2
        with:
          path: |
            ~/.m2/repository
            ~/.cache/runelite
          key: ${{ runner.os }}-cache-${{ hashFiles('**/pom.xml', '**/build.sh', '**/pmd-ruleset.xml') }}
          restore-keys: |
            ${{ runner.os }}-cache-

      - name: Set up JDK 11
        uses: actions/setup-java@v2
        with:
          distribution: adopt
          java-version: 11

      - name: Build
        run: ./ci/build.sh
