name: build

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java-version:
          - 8
          - 9
          - 10
          - 11
          - 12
          - 13
          - 14
          - 15
          - 16
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Java ${{ matrix.java-version }}
        uses: actions/setup-java@v2
        with:
          distribution: adopt
          java-version: ${{ matrix.java-version }}
      - name: Run tests
        run: mvn -e test

  coverage:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Create code coverage report
        run: mvn -e test jacoco:report
      - name: Upload code coverage report
        uses: codecov/codecov-action@v1
        with:
          file: ./**/target/site/jacoco/jacoco.xml
          name: codecov

name: build

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java-version:
          - 8
          - 9
          - 10
          - 11
          - 12
          - 13
          - 14
          - 15
          - 16
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Java ${{ matrix.java-version }}
        uses: actions/setup-java@v2
        with:
          distribution: adopt
          java-version: ${{ matrix.java-version }}
      - name: Run tests
        run: mvn -e test

  coverage:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Create code coverage report
        run: mvn -e test jacoco:report
      - name: Upload code coverage report
        uses: codecov/codecov-action@v2
        with:
          files: ./**/target/site/jacoco/jacoco.xml
          name: codecov

Update codecov/codecov-action action to v2
Update codecov/codecov-action action to v2
