From 0aead925d30a7e0b7221aea76229d0e9cb656295 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 21 Feb 2023 09:52:55 +0000 Subject: [PATCH] Allow disabling coverage for downstream testing (#10198) --- .github/workflows/tests.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebc17831a8..56638218e7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,16 +39,21 @@ jobs: id: cpu-cores uses: SimenB/github-actions-cpu-cores@v1 - - name: Run tests with coverage and metrics + - name: Load metrics reporter + id: metrics if: github.ref == 'refs/heads/develop' - run: "yarn coverage --ci --reporters github-actions '--reporters=/test/slowReporter.js' --max-workers ${{ steps.cpu-cores.outputs.count }}" + run: | + echo "extra-reporter='--reporters=/test/slowReporter.js'" >> $GITHUB_OUTPUT - - name: Run tests with coverage - if: github.ref != 'refs/heads/develop' - run: "yarn coverage --ci --reporters github-actions --max-workers ${{ steps.cpu-cores.outputs.count }}" + - name: Run tests + run: | + yarn ${{ inputs.disable_coverage != 'true' && 'coverage' || 'test' }} \ + --ci \ + --reporters github-actions ${{ steps.metrics.outputs.extra-reporter }} \ + --max-workers ${{ steps.cpu-cores.outputs.count }} - name: Upload Artifact - if: inputs.matrix-js-sdk-sha == '' + if: inputs.disable_coverage != 'true' uses: actions/upload-artifact@v3 with: name: coverage