|
1 | 1 | name: Tests
|
2 | 2 | on:
|
3 | 3 | pull_request: {}
|
| 4 | + merge_group: |
| 5 | + types: [checks_requested] |
4 | 6 | push:
|
5 | 7 | branches: [develop, master]
|
6 | 8 | concurrency:
|
@@ -36,18 +38,19 @@ jobs:
|
36 | 38 | id: cpu-cores
|
37 | 39 | uses: SimenB/github-actions-cpu-cores@v1
|
38 | 40 |
|
39 |
| - - name: Run tests with coverage and metrics |
| 41 | + - name: Load metrics reporter |
| 42 | + id: metrics |
40 | 43 | if: github.ref == 'refs/heads/develop'
|
41 | 44 | run: |
|
42 |
| - yarn coverage --ci --reporters github-actions '--reporters=<rootDir>/spec/slowReporter.js' --max-workers ${{ steps.cpu-cores.outputs.count }} ./spec/${{ matrix.specs }} |
43 |
| - mv coverage/lcov.info coverage/${{ matrix.node }}-${{ matrix.specs }}.lcov.info |
44 |
| - env: |
45 |
| - JEST_SONAR_UNIQUE_OUTPUT_NAME: true |
| 45 | + echo "extra-reporter='--reporters=<rootDir>/spec/slowReporter.js'" >> $GITHUB_OUTPUT |
46 | 46 |
|
47 |
| - - name: Run tests with coverage |
48 |
| - if: github.ref != 'refs/heads/develop' |
| 47 | + - name: Run tests |
49 | 48 | run: |
|
50 |
| - yarn coverage --ci --reporters github-actions --max-workers ${{ steps.cpu-cores.outputs.count }} ./spec/${{ matrix.specs }} |
| 49 | + yarn coverage \ |
| 50 | + --ci \ |
| 51 | + --reporters github-actions ${{ steps.metrics.outputs.extra-reporter }} \ |
| 52 | + --max-workers ${{ steps.cpu-cores.outputs.count }} \ |
| 53 | + ./spec/${{ matrix.specs }} |
51 | 54 | mv coverage/lcov.info coverage/${{ matrix.node }}-${{ matrix.specs }}.lcov.info
|
52 | 55 | env:
|
53 | 56 | JEST_SONAR_UNIQUE_OUTPUT_NAME: true
|
|
59 | 62 | path: |
|
60 | 63 | coverage
|
61 | 64 | !coverage/lcov-report
|
| 65 | +
|
| 66 | + matrix-react-sdk: |
| 67 | + name: Downstream test matrix-react-sdk |
| 68 | + if: github.event_name == 'merge_group' |
| 69 | + uses: matrix-org/matrix-react-sdk/.github/workflows/tests.yml@develop |
| 70 | + with: |
| 71 | + disable_coverage: true |
| 72 | + matrix-js-sdk-sha: ${{ github.sha }} |
| 73 | + |
| 74 | + # Hook for branch protection to work outside merge queues |
| 75 | + downstream: |
| 76 | + name: Downstream tests |
| 77 | + runs-on: ubuntu-latest |
| 78 | + if: always() |
| 79 | + needs: |
| 80 | + - matrix-react-sdk |
| 81 | + steps: |
| 82 | + - if: needs.matrix-react-sdk.result != 'skipped' && needs.matrix-react-sdk.result != 'success' |
| 83 | + run: exit 1 |
0 commit comments