From b73032145d63684daef859d23b0e44450f487a56 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 6 Apr 2023 14:41:20 +0100 Subject: [PATCH] Enable merge queues (#10515) * Enable merge queues * Iterate * Iterate * iterate * Fix check blocked and others not running in MQ * Add concurrency * Iterate * Iterate * Iterate * Iterate * Update pr-details action --- .github/workflows/element-web.yaml | 2 ++ .github/workflows/pull_request.yaml | 2 ++ .github/workflows/static_analysis.yaml | 2 ++ .github/workflows/tests.yml | 24 ++++++++++++++++++++++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/element-web.yaml b/.github/workflows/element-web.yaml index b16bf030de..9b3492630c 100644 --- a/.github/workflows/element-web.yaml +++ b/.github/workflows/element-web.yaml @@ -6,6 +6,8 @@ on: schedule: - cron: "17 4 * * 1-5" # every weekday at 04:17 UTC pull_request: {} + merge_group: + types: [checks_requested] push: branches: [develop, master] repository_dispatch: diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 1c25477d4a..1f49adfcc4 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -2,6 +2,8 @@ name: Pull Request on: pull_request_target: types: [opened, edited, labeled, unlabeled, synchronize] + merge_group: + types: [checks_requested] jobs: action: uses: matrix-org/matrix-js-sdk/.github/workflows/pull_request.yaml@develop diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index c588151a70..360fa2d8bb 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -1,6 +1,8 @@ name: Static Analysis on: pull_request: {} + merge_group: + types: [checks_requested] push: branches: [develop, master] repository_dispatch: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e839bbe3b6..c4377c03b0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,8 @@ name: Tests on: pull_request: {} + merge_group: + types: [checks_requested] push: branches: [develop, master] repository_dispatch: @@ -19,6 +21,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true env: + ENABLE_COVERAGE: ${{ github.event_name != 'merge_group' && inputs.disable_coverage != 'true' }} # These must be set for fetchdep.sh to get the right branch REPOSITORY: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} @@ -60,14 +63,15 @@ jobs: - name: Run tests run: | - yarn ${{ inputs.disable_coverage != 'true' && 'coverage' || 'test' }} \ + yarn test \ + --coverage=${{ env.ENABLE_COVERAGE }} \ --ci \ --reporters github-actions ${{ steps.metrics.outputs.extra-reporter }} \ --max-workers ${{ steps.cpu-cores.outputs.count }} \ --cacheDirectory /tmp/jest_cache - name: Upload Artifact - if: inputs.disable_coverage != 'true' + if: env.ENABLE_COVERAGE == 'true' uses: actions/upload-artifact@v3 with: name: coverage @@ -75,6 +79,22 @@ jobs: coverage !coverage/lcov-report + skip_sonar: + name: Skip SonarCloud in merge queue + if: github.event_name == 'merge_group' || inputs.disable_coverage == 'true' + runs-on: ubuntu-latest + needs: jest + steps: + - name: Skip SonarCloud + uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1 + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + state: success + description: SonarCloud skipped + context: SonarCloud Code Analysis + sha: ${{ github.sha }} + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + app-tests: name: Element Web Integration Tests runs-on: ubuntu-latest