name: Test

on:
  pull_request:
    paths:
      - '**/*.js'
      - '**/*.ts'
      - '**/*.json'
      - '**/*.feature'

concurrency:
  group: "test"
  cancel-in-progress: false

jobs:
  jest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2        # checkout the repo
      - run: npm i                       # install packages
      - run: npm test                    # run tests (configured to use jest-junit reporter)
      - name: Test Report
        uses: dorny/test-reporter@v1
        if: success() || failure()    # run this step even if previous step failed
        with:
          name: JEST Tests            # Name of the check run which will be created
          path: reports/jest-*.xml    # Path to test results
          reporter: jest-junit        # Format of test results
