name: 'E2E Test Report'

on:
  workflow_run:
    workflows: ['CI']                     # runs after CI workflow
    types:
      - completed

permissions:
  checks: write

jobs:
  report:
    runs-on: ubuntu-latest
    steps:
      - uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0
        with:
          artifact: /e2e-test-reports-(.*)/
          name: JEST Tests $1               # Name of the check run which will be created
          path: 'report*.xml'               # Path to test results (inside artifact .zip)
          reporter: jest-junit              # Format of test results
          fail-on-empty: 'true'
