Allow disabling coverage for downstream testing (#10198)

pull/28788/head^2
Michael Telatynski 2023-02-21 09:52:55 +00:00 committed by GitHub
parent b870f6166c
commit 0aead925d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 6 deletions

View File

@ -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=<rootDir>/test/slowReporter.js' --max-workers ${{ steps.cpu-cores.outputs.count }}"
run: |
echo "extra-reporter='--reporters=<rootDir>/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