11name : Tests
22on :
33 pull_request : {}
4+ merge_group :
5+ types : [checks_requested]
46 push :
57 branches : [develop, master]
68 repository_dispatch :
@@ -19,6 +21,7 @@ concurrency:
1921 group : ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
2022 cancel-in-progress : true
2123env :
24+ ENABLE_COVERAGE : ${{ github.event_name != 'merge_group' && inputs.disable_coverage != 'true' }}
2225 # These must be set for fetchdep.sh to get the right branch
2326 REPOSITORY : ${{ github.repository }}
2427 PR_NUMBER : ${{ github.event.pull_request.number }}
@@ -60,21 +63,38 @@ jobs:
6063
6164 - name : Run tests
6265 run : |
63- yarn ${{ inputs.disable_coverage != 'true' && 'coverage' || 'test' }} \
66+ yarn test \
67+ --coverage=${{ env.ENABLE_COVERAGE }} \
6468 --ci \
6569 --reporters github-actions ${{ steps.metrics.outputs.extra-reporter }} \
6670 --max-workers ${{ steps.cpu-cores.outputs.count }} \
6771 --cacheDirectory /tmp/jest_cache
6872
6973 - name : Upload Artifact
70- if : inputs.disable_coverage ! = 'true'
74+ if : env.ENABLE_COVERAGE = = 'true'
7175 uses : actions/upload-artifact@v3
7276 with :
7377 name : coverage
7478 path : |
7579 coverage
7680 !coverage/lcov-report
7781
82+ skip_sonar :
83+ name : Skip SonarCloud in merge queue
84+ if : github.event_name == 'merge_group' || inputs.disable_coverage == 'true'
85+ runs-on : ubuntu-latest
86+ needs : jest
87+ steps :
88+ - name : Skip SonarCloud
89+ uses : Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1
90+ with :
91+ authToken : ${{ secrets.GITHUB_TOKEN }}
92+ state : success
93+ description : SonarCloud skipped
94+ context : SonarCloud Code Analysis
95+ sha : ${{ github.sha }}
96+ target_url : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
97+
7898 app-tests :
7999 name : Element Web Integration Tests
80100 runs-on : ubuntu-latest
0 commit comments