name: Java CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ 8, 11 ]

    steps:
      - uses: actions/checkout@v2

      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}

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

      - name: Run tests
        run: mvn --batch-mode --update-snapshots verify

      - name: Submit test coverage to Coveralls
        run: mvn jacoco:report coveralls:report -DrepoToken=${{ secrets.COVERALLS_TOKEN }} -DpullRequest=${{ github.event.number }} -DserviceBuildNumber=${{ env.GITHUB_RUN_ID }}

name: Java CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ 8, 11 ]

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-${{ matrix.java }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-${{ matrix.java }}-m2
      - run: mvn --batch-mode --update-snapshots verify

Revert "Submit coverage to coveralls"
Revert "Submit coverage to coveralls"

This reverts commit 42ba719a7afa725a837af0be1976cdc115a06381.

This fails for PRs opened from forks, we need a better solution:
https://securitylab.github.com/research/github-actions-preventing-pwn-requests
