name: Build and Test JTReg

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - '*'

jobs:

  linux-x64:
    runs-on: ubuntu-latest

    steps:
    - name: 'Check out repository'
      uses: actions/checkout@v2
      with:
        fetch-depth: 1

    - name: 'Build JTReg'
      shell: bash
      run: |
        java --version
        bash make/build.sh --jdk ${JAVA_HOME_11_X64}

    - name: 'Run initial tests (goal: quick-test)'
      shell: bash
      env:
        MAKE_ARGS: quick-test
        HEADLESS: 1
      run: |
        bash make/build.sh --jdk ${JAVA_HOME_11_X64} --skip-download

    - name: 'Run all tests (goal: test)'
      shell: bash
      env:
        MAKE_ARGS: test
        HEADLESS: 1
      run: |
        bash make/build.sh --jdk ${JAVA_HOME_11_X64} --skip-download
