name: Java CI

on: [push, pull_request]

jobs:
  build:
    strategy:
      matrix:
        platform: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.platform }}

    steps:
      - name: Set up repository
        uses: actions/checkout@master

      - name: Set up repository
        uses: actions/checkout@master
        with:
          ref: master

      - name: Merge to master
        run: git checkout --progress --force ${{ github.sha }}

      - name: Run repository-wide tests
        if: runner.os == 'Linux'
        working-directory:  ${{ github.workspace }}/.github
        run: ./run-checks.sh

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Setup JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: '11'
          java-package: jdk+fx

      - name: Build and check with Gradle
        run: ./gradlew check coverage

      - uses: codecov/codecov-action@v1
        if: runner.os == 'Linux'
        with:
          file: ${{ github.workspace }}/build/reports/jacoco/coverage/coverage.xml
          fail_ci_if_error: true

name: Java CI

on: [push, pull_request]

jobs:
  build:
    strategy:
      matrix:
        platform: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.platform }}

    steps:
      - name: Set up repository
        uses: actions/checkout@main

      - name: Set up repository
        uses: actions/checkout@main
        with:
          ref: master

      - name: Merge to master
        run: git checkout --progress --force ${{ github.sha }}

      - name: Run repository-wide tests
        if: runner.os == 'Linux'
        working-directory:  ${{ github.workspace }}/.github
        run: ./run-checks.sh

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Setup JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: '11'
          java-package: jdk+fx

      - name: Build and check with Gradle
        run: ./gradlew check coverage

      - uses: codecov/codecov-action@v1
        if: runner.os == 'Linux'
        with:
          file: ${{ github.workspace }}/build/reports/jacoco/coverage/coverage.xml
          fail_ci_if_error: true

Update Checkout action default branch
Update Checkout action default branch

GitHub Actions gives a warning that the checkout action no longer has
'master' as the default branch. This is because the checkout actions
repo itself has renamed its default branch from 'master' to 'main'.

The action may eventually break when the 'master' branch option is
no longer supported.

Let's update the CI workflow to use actions/checkout@main instead of
actions/checkout@master, to fix the warning.
