From 0f766e23c235ffb919e79282879e7131d4cdb498 Mon Sep 17 00:00:00 2001 From: katsuyoshi ozaki Date: Mon, 1 Apr 2024 15:56:17 +0900 Subject: [PATCH] Removed files for GitHub Actions that were set up for matrix-react-sdk. --- .github/CODEOWNERS | 5 - .github/FUNDING.yml | 2 - .github/PULL_REQUEST_TEMPLATE.md | 26 --- .github/release-drafter.yml | 1 - .github/renovate.json | 4 - .github/workflows/backport.yml | 30 --- .github/workflows/cypress.yaml | 229 ----------------------- .github/workflows/element-web.yaml | 91 --------- .github/workflows/end-to-end-tests.yaml | 148 --------------- .github/workflows/localazy_download.yaml | 10 - .github/workflows/localazy_upload.yaml | 11 -- .github/workflows/netlify.yaml | 49 ----- .github/workflows/notify-element-web.yml | 19 -- .github/workflows/pull_request.yaml | 11 -- .github/workflows/release-drafter.yml | 21 --- .github/workflows/release-gitflow.yml | 13 -- .github/workflows/release.yml | 32 ---- .github/workflows/sonarqube.yml | 16 -- .github/workflows/static_analysis.yaml | 137 -------------- .github/workflows/tests.yml | 107 ----------- 20 files changed, 962 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/release-drafter.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/backport.yml delete mode 100644 .github/workflows/cypress.yaml delete mode 100644 .github/workflows/element-web.yaml delete mode 100644 .github/workflows/end-to-end-tests.yaml delete mode 100644 .github/workflows/localazy_download.yaml delete mode 100644 .github/workflows/localazy_upload.yaml delete mode 100644 .github/workflows/netlify.yaml delete mode 100644 .github/workflows/notify-element-web.yml delete mode 100644 .github/workflows/pull_request.yaml delete mode 100644 .github/workflows/release-drafter.yml delete mode 100644 .github/workflows/release-gitflow.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/sonarqube.yml delete mode 100644 .github/workflows/static_analysis.yaml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index b436b4e..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,5 +0,0 @@ -* @matrix-org/element-web -/.github/workflows/** @matrix-org/element-web-app-team -/package.json @matrix-org/element-web-app-team -/yarn.lock @matrix-org/element-web-app-team -/src/i18n/strings diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index afc29f0..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -patreon: matrixdotorg -liberapay: matrixdotorg diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index a34327a..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,26 +0,0 @@ - - -## Checklist - -- [ ] Tests written for new code (and old code if feasible) -- [ ] Linter and other CI checks pass -- [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/matrix-org/matrix-react-sdk/blob/develop/CONTRIBUTING.md)) - - diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index e9d334f..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1 +0,0 @@ -_extends: matrix-org/matrix-js-sdk diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 7632042..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>matrix-org/renovate-config-element-web"] -} diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index dd79389..0000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Backport -on: - pull_request_target: - types: - - closed - - labeled - branches: - - develop - -jobs: - backport: - name: Backport - runs-on: ubuntu-latest - # Only react to merged PRs for security reasons. - # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. - if: > - github.event.pull_request.merged - && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport') - ) - ) - steps: - - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2 - with: - labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>" - # We can't use GITHUB_TOKEN here or CI won't run on the new PR - github_token: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml deleted file mode 100644 index 940b737..0000000 --- a/.github/workflows/cypress.yaml +++ /dev/null @@ -1,229 +0,0 @@ -# Triggers after the layered build has finished, taking the artifact and running cypress on it -# -# Also called by a workflow in matrix-js-sdk. -# -name: Cypress End to End Tests -on: - workflow_run: - workflows: ["Element Web - Build"] - types: - - completed - - # support calls from other workflows - workflow_call: - inputs: - react-sdk-repository: - type: string - required: true - description: "The name of the github repository to check out and build." - secrets: - CYPRESS_RECORD_KEY: - required: true - TCMS_USERNAME: - required: true - TCMS_PASSWORD: - required: true - -concurrency: - group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }} - cancel-in-progress: ${{ github.event.workflow_run.event == 'pull_request' }} - -jobs: - prepare: - name: Prepare - if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - permissions: - actions: read - issues: read - statuses: write - pull-requests: read - outputs: - uuid: ${{ steps.uuid.outputs.value }} - pr_id: ${{ steps.prdetails.outputs.pr_id }} - percy_enable: ${{ steps.percy.outputs.value || '0' }} - steps: - # We create the status here and then update it to success/failure in the `report` stage - # This provides an easy link to this workflow_run from the PR before Cypress is done. - - uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1 - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: pending - context: ${{ github.workflow }} / cypress - sha: ${{ github.event.workflow_run.head_sha }} - target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - - id: prdetails - if: github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'merge_group' - uses: matrix-org/pr-details-action@v1.3 - with: - owner: ${{ github.event.workflow_run.head_repository.owner.login }} - branch: ${{ github.event.workflow_run.head_branch }} - - # Percy is disabled while we're figuring out https://github.com/vector-im/wat-internal/issues/36 - # and https://github.com/vector-im/wat-internal/issues/56. We're hoping to turn it back on or switch - # to an alternative in the future. - # # Only run Percy when it is demanded or we are running the daily build - # - name: Enable Percy - # id: percy - # if: | - # github.event.workflow_run.event == 'schedule' || - # ( - # github.event.workflow_run.event == 'merge_group' && - # contains(fromJSON(steps.prdetails.outputs.data).labels.*.name, 'X-Needs-Percy') - # ) - # run: echo "value=1" >> $GITHUB_OUTPUT - - - name: Generate unique ID 💎 - id: uuid - run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT - - tests: - name: "Run Tests (${{ matrix.crypto }} crypto)" - needs: prepare - runs-on: ubuntu-latest - permissions: - actions: read - issues: read - pull-requests: read - environment: Cypress - strategy: - fail-fast: false - matrix: - # Run tests using both crypto stacks - crypto: [legacy, rust] - ci_node_total: [4] - ci_node_index: [0, 1, 2, 3] - steps: - # The version of chrome shipped by default may not be consistent across runners - # so we explicitly use a specific version of chrome here. - - uses: browser-actions/setup-chrome@803ef6dfb4fdf22089c9563225d95e4a515820a0 # v1 - - run: echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV - - # There's a 'download artifact' action, but it hasn't been updated for the workflow_run action - # (https://github.com/actions/download-artifact/issues/60) so instead we get this mess: - - name: 📥 Download artifact - uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: previewbuild - path: webapp - - # The workflow_run.head_sha is the sha of the head commit but the element-web was built using a simulated - # merge commit - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request - # so use the sha from the tarball for the checkout of the cypress tests - # to make sure we get a matching set of code and tests. - - name: Grab sha from webapp - id: sha - run: | - echo "sha=$(cat webapp/sha)" >> $GITHUB_OUTPUT - - - uses: actions/checkout@v4 - with: - # XXX: We're checking out untrusted code in a secure context - # We need to be careful to not trust anything this code outputs/may do - # - # Note that (in the absence of a `react-sdk-repository` input), - # we check out from the default repository, which is (for this workflow) the - # *target* repository for the pull request. - # - ref: ${{ steps.sha.outputs.sha }} - persist-credentials: false - path: matrix-react-sdk - repository: ${{ inputs.react-sdk-repository || github.repository }} - - # Enable rust crypto if the calling workflow requests it - - name: Enable rust crypto - if: matrix.crypto == 'rust' - run: | - echo "CYPRESS_RUST_CRYPTO=1" >> "$GITHUB_ENV" - - - name: Run Cypress tests via knapsack pro - uses: cypress-io/github-action@ebe8b24c4428922d0f793a5c4c96853a633180e3 # v6.6.0 - with: - working-directory: matrix-react-sdk - headed: true - start: npx serve -p 8080 -L ../webapp - wait-on: "http://localhost:8080" - record: false - parallel: false - # The built-in Electron runner seems to grind to a halt trying to run the tests, so use chrome. - command: yarn percy exec --parallel -- npx knapsack-pro-cypress --config trashAssetsBeforeRuns=false --browser ${{ env.BROWSER_PATH }} - env: - # Knapsack token and config - KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS: ${{ matrix.crypto == 'rust' && secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS_RUST || secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS_LEGACY }} - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_TEST_FILE_PATTERN: cypress/e2e/**/*.spec.ts - KNAPSACK_PRO_BRANCH: ${{ github.event.workflow_run.head_branch }} - KNAPSACK_PRO_COMMIT_HASH: ${{ github.event.workflow_run.head_sha }} - - # Use existing chromium rather than downloading another - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true - - # pass GitHub token to allow accurately detecting a build vs a re-run build - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # make Node's os.tmpdir() return something where we actually have permissions - TMPDIR: ${{ runner.temp }} - - # pass the Percy token as an environment variable - PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} - - # only run percy on legacy crypto (for now) - PERCY_ENABLE: ${{ matrix.crypto == 'legacy' && needs.prepare.outputs.percy_enable || 0 }} - PERCY_BROWSER_EXECUTABLE: ${{ steps.setup-chrome.outputs.chrome-path }} - # tell Percy more details about the context of this run - PERCY_BRANCH: ${{ github.event.workflow_run.head_branch }} - PERCY_COMMIT: ${{ github.event.workflow_run.head_sha }} - PERCY_PULL_REQUEST: ${{ needs.prepare.outputs.pr_id }} - PERCY_PARALLEL_NONCE: ${{ needs.prepare.outputs.uuid }} - # We manually finalize the build in the report stage - PERCY_PARALLEL_TOTAL: -1 - - - name: 📤 Upload results artifact - if: failure() - uses: actions/upload-artifact@v3 - with: - name: cypress-results-${{ matrix.crypto }}-crypto - path: | - matrix-react-sdk/cypress/screenshots - matrix-react-sdk/cypress/videos - matrix-react-sdk/cypress/synapselogs - matrix-react-sdk/cypress/results/cypresslogs - - report: - name: Finalize results - needs: - - prepare - - tests - runs-on: ubuntu-latest - if: always() - permissions: - statuses: write - steps: - - name: Finalize Percy - if: needs.prepare.outputs.percy_enable == '1' - run: npx -p @percy/cli percy build:finalize - env: - PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} - PERCY_PARALLEL_NONCE: ${{ needs.prepare.outputs.uuid }} - - - name: Skip Percy required check - if: needs.prepare.outputs.percy_enable != '1' - uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1 - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: success - description: Percy skipped - context: percy/matrix-react-sdk - sha: ${{ github.event.workflow_run.head_sha }} - target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - - uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1 - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: ${{ needs.tests.result == 'success' && 'success' || 'failure' }} - context: ${{ github.workflow }} / cypress - sha: ${{ github.event.workflow_run.head_sha }} - target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/element-web.yaml b/.github/workflows/element-web.yaml deleted file mode 100644 index 7b085d8..0000000 --- a/.github/workflows/element-web.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Produce a build of element-web with this version of react-sdk -# and any matching branches of element-web and js-sdk, output it -# as an artifact and run integration tests. -name: Element Web - Build -on: - # We only need the nightly run for Percy which is disabled while we're - # figuring out https://github.com/vector-im/wat-internal/issues/36 and - # https://github.com/vector-im/wat-internal/issues/56. We're hoping to - # turn it back on or switch to an alternative in the future. - # 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: - types: [upstream-sdk-notify] - - # support triggering from other workflows - workflow_call: - inputs: - react-sdk-repository: - type: string - required: true - description: "The name of the github repository to check out and build." - - matrix-js-sdk-sha: - type: string - required: false - description: "The Git SHA of matrix-js-sdk to build against. By default, will use a matching branch name if it exists, or develop." - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -env: - # fetchdep.sh needs to know our PR number - PR_NUMBER: ${{ github.event.pull_request.number }} - -jobs: - build: - name: "Build Element-Web" - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - repository: ${{ inputs.react-sdk-repository || github.repository }} - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - - name: Fetch layered build - id: layered_build - env: - # tell layered.sh to check out the right sha of the JS-SDK, if we were given one - JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} - run: | - scripts/ci/layered.sh - JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD) - REACT_SHA=$(git rev-parse --short=12 HEAD) - VECTOR_SHA=$(git -C element-web rev-parse --short=12 HEAD) - echo "VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA" >> $GITHUB_OUTPUT - - - name: Copy config - run: cp element.io/develop/config.json config.json - working-directory: ./element-web - - - name: Build - env: - CI_PACKAGE: true - VERSION: "${{ steps.layered_build.outputs.VERSION }}" - run: | - yarn build - echo $VERSION > webapp/version - working-directory: ./element-web - - # Record the react-sdk sha so our cypress tests are from the same sha - - name: Record react-sdk SHA - run: | - git rev-parse HEAD > element-web/webapp/sha - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: previewbuild - path: element-web/webapp - # We'll only use this in a triggered job, then we're done with it - retention-days: 1 diff --git a/.github/workflows/end-to-end-tests.yaml b/.github/workflows/end-to-end-tests.yaml deleted file mode 100644 index d6eedbc..0000000 --- a/.github/workflows/end-to-end-tests.yaml +++ /dev/null @@ -1,148 +0,0 @@ -# Triggers after the layered build has finished, taking the artifact and running Playwright on it -name: End to End Tests -on: - workflow_run: - workflows: ["Element Web - Build"] - types: - - completed - -concurrency: - group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }} - cancel-in-progress: ${{ github.event.workflow_run.event == 'pull_request' }} - -jobs: - prepare: - name: Prepare - if: github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - permissions: - statuses: write - steps: - # We create the status here and then update it to success/failure in the `report` stage - # This provides an easy link to this workflow_run from the PR before the tests are done. - - uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1 - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: pending - context: ${{ github.workflow }} / end-to-end-tests - sha: ${{ github.event.workflow_run.head_sha }} - target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - tests: - name: "Run Tests ${{ matrix.runner }}/${{ strategy.job-total }}" - needs: prepare - runs-on: ubuntu-latest - permissions: - actions: read - issues: read - pull-requests: read - environment: EndToEndTests - strategy: - fail-fast: false - matrix: - # Run 2 instances in Parallel - runner: [1, 2] - steps: - - uses: browser-actions/setup-chrome@803ef6dfb4fdf22089c9563225d95e4a515820a0 # v1 - - run: echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV - - # There's a 'download artifact' action, but it hasn't been updated for the workflow_run action - # (https://github.com/actions/download-artifact/issues/60) so instead we get this mess: - - name: 📥 Download artifact - uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: previewbuild - path: webapp - - # The workflow_run.head_sha is the sha of the head commit but the element-web was built using a simulated - # merge commit - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request - # so use the sha from the tarball for the checkout of the tests - # to make sure we get a matching set of code and tests. - - name: Grab sha from webapp - id: sha - run: | - echo "sha=$(cat webapp/sha)" >> $GITHUB_OUTPUT - - - uses: actions/checkout@v4 - with: - # XXX: We're checking out untrusted code in a secure context - # We need to be careful to not trust anything this code outputs/may do - # - # Note that (in the absence of a `react-sdk-repository` input), - # we check out from the default repository, which is (for this workflow) the - # *target* repository for the pull request. - # - ref: ${{ steps.sha.outputs.sha }} - persist-credentials: false - path: matrix-react-sdk - repository: ${{ inputs.react-sdk-repository || github.repository }} - - - uses: actions/setup-node@v3 - with: - cache: "yarn" - cache-dependency-path: matrix-react-sdk/yarn.lock - - - name: Install dependencies - working-directory: matrix-react-sdk - run: yarn install --frozen-lockfile - - - name: Install Playwright browsers - working-directory: matrix-react-sdk - run: yarn playwright install --with-deps - - - name: Run Playwright tests - uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1 - with: - run: yarn playwright test --shard ${{ matrix.runner }}/${{ strategy.job-total }} - working-directory: matrix-react-sdk - - - name: Upload blob report to GitHub Actions Artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: all-blob-reports - path: matrix-react-sdk/blob-report - retention-days: 1 - - report: - name: Report results - needs: tests - runs-on: ubuntu-latest - if: always() - permissions: - statuses: write - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - cache: "yarn" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Download blob reports from GitHub Actions Artifacts - uses: actions/download-artifact@v3 - with: - name: all-blob-reports - path: all-blob-reports - - - name: Merge into HTML Report - run: yarn playwright merge-reports --reporter=html,github ./all-blob-reports - - - name: Upload HTML report - uses: actions/upload-artifact@v3 - with: - name: html-report--attempt-${{ github.run_attempt }} - path: playwright-report - retention-days: 14 - - - uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1 - if: always() - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - state: ${{ needs.tests.result == 'success' && 'success' || 'failure' }} - context: ${{ github.workflow }} / end-to-end-tests - sha: ${{ github.event.workflow_run.head_sha }} - target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/localazy_download.yaml b/.github/workflows/localazy_download.yaml deleted file mode 100644 index a880c3b..0000000 --- a/.github/workflows/localazy_download.yaml +++ /dev/null @@ -1,10 +0,0 @@ -name: Localazy Download -on: - workflow_dispatch: {} - schedule: - - cron: "0 6 * * 1,3,5" # Every Monday, Wednesday and Friday at 6am UTC -jobs: - download: - uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main - secrets: - ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/workflows/localazy_upload.yaml b/.github/workflows/localazy_upload.yaml deleted file mode 100644 index 9ba7980..0000000 --- a/.github/workflows/localazy_upload.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Localazy Upload -on: - push: - branches: [develop] - paths: - - "src/i18n/strings/en_EN.json" -jobs: - upload: - uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_upload.yaml@main - secrets: - LOCALAZY_WRITE_KEY: ${{ secrets.LOCALAZY_WRITE_KEY }} diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml deleted file mode 100644 index 3092cfb..0000000 --- a/.github/workflows/netlify.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Triggers after the layered build has finished, taking the artifact -# and uploading it to netlify -name: Upload Preview Build to Netlify -on: - workflow_run: - workflows: ["Element Web - Build"] - types: - - completed -jobs: - deploy: - if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' - runs-on: ubuntu-latest - environment: Netlify - steps: - - name: 📝 Create Deployment - uses: bobheadxi/deployments@88ce5600046c82542f8246ac287d0a53c461bca3 # v1 - id: deployment - with: - step: start - token: ${{ secrets.GITHUB_TOKEN }} - env: Netlify - ref: ${{ github.event.workflow_run.head_sha }} - desc: | - Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. - Exercise caution. Use test accounts. - - # There's a 'download artifact' action, but it hasn't been updated for the workflow_run action - # (https://github.com/actions/download-artifact/issues/60) so instead we get this mess: - - name: 📥 Download artifact - uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: previewbuild - path: webapp - - - name: 📤 Deploy to Netlify - uses: matrix-org/netlify-pr-preview@v2 - with: - path: webapp - owner: ${{ github.event.workflow_run.head_repository.owner.login }} - branch: ${{ github.event.workflow_run.head_branch }} - revision: ${{ github.event.workflow_run.head_sha }} - token: ${{ secrets.NETLIFY_AUTH_TOKEN }} - site_id: ${{ secrets.NETLIFY_SITE_ID }} - deployment_env: ${{ steps.deployment.outputs.env }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - desc: | - Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. - Exercise caution. Use test accounts. diff --git a/.github/workflows/notify-element-web.yml b/.github/workflows/notify-element-web.yml deleted file mode 100644 index 9f88c61..0000000 --- a/.github/workflows/notify-element-web.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Notify element-web -on: - push: - branches: [develop] - repository_dispatch: - types: [upstream-sdk-notify] -jobs: - notify-element-web: - name: "Notify Element Web" - runs-on: ubuntu-latest - # Only respect triggers from our develop branch, ignore that of forks - if: github.repository == 'matrix-org/matrix-react-sdk' - steps: - - name: Notify element-web repo that a new SDK build is on develop - uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2 - with: - token: ${{ secrets.ELEMENT_BOT_TOKEN }} - repository: vector-im/element-web - event-type: element-web-notify diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml deleted file mode 100644 index 1f49adf..0000000 --- a/.github/workflows/pull_request.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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 - secrets: - ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 4d889f4..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release Drafter -on: - push: - branches: [staging] - workflow_dispatch: - inputs: - previous-version: - description: What release to use as a base for release note purposes - required: false - type: string -concurrency: ${{ github.workflow }} -jobs: - draft: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@e64b19c4c46173209ed9f2e5a2f4ca7de89a0e86 # v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - disable-autolabeler: true - previous-version: ${{ inputs.previous-version }} diff --git a/.github/workflows/release-gitflow.yml b/.github/workflows/release-gitflow.yml deleted file mode 100644 index b515bb4..0000000 --- a/.github/workflows/release-gitflow.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Gitflow merge-back master->develop -name: Merge master -> develop -on: - push: - branches: [master] -concurrency: ${{ github.repository }}-${{ github.workflow }} -jobs: - merge: - uses: matrix-org/matrix-js-sdk/.github/workflows/release-gitflow.yml@develop - secrets: inherit - with: - dependencies: | - matrix-js-sdk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d17d81f..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Release Process -on: - workflow_dispatch: - inputs: - mode: - description: What type of release - required: true - default: rc - type: choice - options: - - rc - - final - matrix-js-sdk: - description: JS SDK version to use (current|X.Y.Z) - required: false - default: current - type: string - npm: - description: Publish to npm - required: true - type: boolean - default: true -concurrency: ${{ github.workflow }} -jobs: - release: - uses: matrix-org/matrix-js-sdk/.github/workflows/release-make.yml@develop - secrets: inherit - with: - final: ${{ inputs.mode == 'final' }} - npm: ${{ inputs.npm }} - dependencies: | - matrix-js-sdk=${{ inputs.matrix-js-sdk }} diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml deleted file mode 100644 index 1293e6e..0000000 --- a/.github/workflows/sonarqube.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: SonarQube -on: - workflow_run: - workflows: ["Tests"] - types: - - completed -concurrency: - group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }} - cancel-in-progress: true -jobs: - sonarqube: - name: 🩻 SonarQube - if: github.event.workflow_run.event != 'merge_group' - uses: matrix-org/matrix-js-sdk/.github/workflows/sonarcloud.yml@develop - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml deleted file mode 100644 index cae9e9d..0000000 --- a/.github/workflows/static_analysis.yaml +++ /dev/null @@ -1,137 +0,0 @@ -name: Static Analysis -on: - pull_request: {} - merge_group: - types: [checks_requested] - push: - branches: [develop, master] - repository_dispatch: - types: [upstream-sdk-notify] -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -env: - # fetchdep.sh needs to know our PR number - PR_NUMBER: ${{ github.event.pull_request.number }} - -jobs: - ts_lint: - name: "Typescript Syntax Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - - name: Install Deps - run: "./scripts/ci/install-deps.sh --ignore-scripts" - - - name: Typecheck - run: "yarn run lint:types" - - - name: Switch js-sdk to release mode - working-directory: node_modules/matrix-js-sdk - run: | - scripts/switch_package_to_release.js - yarn install - yarn run build:compile - yarn run build:types - - - name: Typecheck (release mode) - run: "yarn run lint:types" - - # Temporary while we directly import matrix-js-sdk/src/* which means we need - # certain @types/* packages to make sense of matrix-js-sdk types. - #- name: Typecheck (release mode; no yarn link) - # if: github.event_name != 'pull_request' && github.ref_name != 'master' - # run: | - # yarn unlink matrix-js-sdk - # yarn add github:matrix-org/matrix-js-sdk#develop - # yarn install --force - # yarn run lint:types - - i18n_lint: - name: "i18n Check" - uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@main - - rethemendex_lint: - name: "Rethemendex Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - run: ./res/css/rethemendex.sh - - - run: git diff --exit-code - - js_lint: - name: "ESLint" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - # Does not need branch matching as only analyses this layer - - name: Install Deps - run: "yarn install" - - - name: Run Linter - run: "yarn run lint:js" - - style_lint: - name: "Style Lint" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - # Does not need branch matching as only analyses this layer - - name: Install Deps - run: "yarn install" - - - name: Run Linter - run: "yarn run lint:style" - - workflow_lint: - name: "Workflow Lint" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - # Does not need branch matching as only analyses this layer - - name: Install Deps - run: "yarn install --frozen-lockfile" - - - name: Run Linter - run: "yarn lint:workflows" - - analyse_dead_code: - name: "Analyse Dead Code" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - - name: Install Deps - run: "scripts/ci/layered.sh" - - - name: Dead Code Analysis - run: | - cd element-web - yarn run analyse:unused-exports diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index b283888..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Tests -on: - pull_request: {} - merge_group: - types: [checks_requested] - push: - branches: [develop, master] - repository_dispatch: - types: [upstream-sdk-notify] - workflow_call: - inputs: - disable_coverage: - type: boolean - required: false - description: "Specify true to skip generating and uploading coverage for tests" - matrix-js-sdk-sha: - type: string - required: false - description: "The matrix-js-sdk SHA to use" -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' }} - # fetchdep.sh needs to know our PR number - PR_NUMBER: ${{ github.event.pull_request.number }} - -jobs: - jest: - name: Jest - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - repository: ${{ inputs.matrix-js-sdk-sha && 'matrix-org/matrix-react-sdk' || github.repository }} - - - name: Yarn cache - uses: actions/setup-node@v4 - with: - cache: "yarn" - - - name: Install Deps - run: "./scripts/ci/install-deps.sh --ignore-scripts" - env: - JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} - - - name: Jest Cache - uses: actions/cache@v3 - with: - path: /tmp/jest_cache - key: ${{ hashFiles('**/yarn.lock') }} - - - name: Get number of CPU cores - id: cpu-cores - uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2 - - - name: Run tests - run: | - yarn test \ - --coverage=${{ env.ENABLE_COVERAGE }} \ - --ci \ - --max-workers ${{ steps.cpu-cores.outputs.count }} \ - --cacheDirectory /tmp/jest_cache - - - name: Upload Artifact - if: env.ENABLE_COVERAGE == 'true' - uses: actions/upload-artifact@v3 - with: - name: coverage - path: | - 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 - steps: - - uses: actions/checkout@v4 - with: - repository: ${{ inputs.matrix-js-sdk-sha && 'matrix-org/matrix-react-sdk' || github.repository }} - - - uses: actions/setup-node@v4 - with: - cache: "yarn" - - - name: Run tests - run: "./scripts/ci/app-tests.sh" - env: - JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}