From 6f6aff3c419ea145117fd51da6934634ce9c0116 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 6 May 2024 17:32:40 +0100 Subject: [PATCH] chore: change to use artefacts but extend them --- .github/workflows/annotate-test-reports.yml | 30 +++++++++++++++++++++ .github/workflows/pr-coverage.yml | 3 +-- .github/workflows/test.yml | 16 +++-------- 3 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/annotate-test-reports.yml diff --git a/.github/workflows/annotate-test-reports.yml b/.github/workflows/annotate-test-reports.yml new file mode 100644 index 0000000..653f17c --- /dev/null +++ b/.github/workflows/annotate-test-reports.yml @@ -0,0 +1,30 @@ +name: Annotate CI run with test results +on: + workflow_run: + workflows: ["Run Tests"] + types: + - completed +permissions: + contents: read + +jobs: + annotate: + permissions: + checks: write + + name: Annotate CI run with test results + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion != 'cancelled' }} + strategy: + fail-fast: false + matrix: + node-version: [18.x, 20.x, 22.x] + timeout-minutes: 5 + steps: + - name: Annotate CI run with test results + uses: dorny/test-reporter@v1.8.0 + with: + artifact: test-reports-${{ matrix.node-version }} + name: Test Results (${{matrix.node-version}} + path: "test-results.json" + reporter: mocha-json \ No newline at end of file diff --git a/.github/workflows/pr-coverage.yml b/.github/workflows/pr-coverage.yml index b05e148..98b903e 100644 --- a/.github/workflows/pr-coverage.yml +++ b/.github/workflows/pr-coverage.yml @@ -10,11 +10,10 @@ permissions: jobs: coverage_report: name: Generate coverage report - needs: testing runs-on: ubuntu-latest strategy: matrix: - node-version: 22.x + node-version: [20.x] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37cc370..784b387 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,8 +10,6 @@ permissions: contents: read checks: write pull-requests: write - actions: read - checks: write jobs: build: @@ -37,16 +35,8 @@ jobs: - name: Run Tests and Linting run: npm run test - - - name: Test Report - uses: dorny/test-reporter@v1 - with: - name: Mocha Tests - path: test/reports/test-results.json - reporter: mocha-json - - name: Cucumber annotations - uses: deblockt/cucumber-report-annotations-action@v1.7 + - uses: actions/upload-artifact@v3 with: - access-token: ${{ secrets.GITHUB_TOKEN }} - path: "test/reports/cucumber-report.json" + name: test-reports-${{ matrix.node-version }} + path: test/reports/