# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Coverage Report

on:
  schedule:
    - cron: '0 0 * * 0'

jobs:
  applications:
    name: Coverage Report ${{ matrix.java-version }}
    if: github.repository == 'eclipse/eclipse-collections'
    strategy:
      matrix:
        os: [ubuntu-latest]
        java-version: [11]

    runs-on: ${{ matrix.os }}

    env:
      JAVA_VERSION: ${{ matrix.java-version }}

    steps:
      - uses: actions/checkout@v3
      - name: Set JDK ${{ matrix.java-version }}
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: ${{ matrix.java-version }}
      - name: Generate Coverage Report
        run: mvn clean verify
      - name: Archive Jacoco reports
        uses: actions/upload-artifact@v3
        with:
          name: jacoco-reports
          path: test-coverage/target/site/jacoco-aggregate
