From e6cb460dd3a6b3efb4e6927081d748fdbec233a4 Mon Sep 17 00:00:00 2001 From: Jay Quan Date: Tue, 20 Jun 2023 09:45:34 +0200 Subject: [PATCH] chore: remove unnecessary yaml files --- .github/FUNDING.yml | 2 - .github/workflows/backport.yml | 30 --- .github/workflows/cypress.yaml | 286 --------------------- .github/workflows/element-web.yaml | 87 ------- .github/workflows/i18n_check.yml | 40 --- .github/workflows/netlify.yaml | 70 ----- .github/workflows/notify-element-web.yml | 19 -- .github/workflows/pull_request.yaml | 11 - .github/workflows/release.yml | 11 - .github/workflows/sonarqube.yml | 16 -- .github/workflows/static_analysis.yaml | 150 ----------- .github/workflows/tests.yml | 107 -------- .github/workflows/upgrade_dependencies.yml | 8 - 13 files changed, 837 deletions(-) delete mode 100644 .github/FUNDING.yml 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/i18n_check.yml 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.yml delete mode 100644 .github/workflows/sonarqube.yml delete mode 100644 .github/workflows/static_analysis.yaml delete mode 100644 .github/workflows/tests.yml delete mode 100644 .github/workflows/upgrade_dependencies.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index afc29f01425..00000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -patreon: matrixdotorg -liberapay: matrixdotorg diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index e10937278f0..00000000000 --- 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@2e217641d82d02ba0603f46b1aeedefb258890ac # 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 df737c6ab44..00000000000 --- a/.github/workflows/cypress.yaml +++ /dev/null @@ -1,286 +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." - rust-crypto: - type: boolean - required: false - description: "Enable Rust cryptography for the cypress run." - secrets: - CYPRESS_RECORD_KEY: - 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 }} - commit_message: ${{ steps.commit.outputs.message }} - commit_author: ${{ steps.commit.outputs.author }} - commit_email: ${{ steps.commit.outputs.email }} - percy_enable: ${{ steps.percy.outputs.value || '0' }} - kiwi_enable: ${{ steps.kiwi.outputs.value || '1' }} - 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 }} - - - name: Get commit details - id: commit - if: github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'merge_group' - uses: actions/github-script@v6 - with: - script: | - const response = await github.rest.git.getCommit({ - owner: context.repo.owner, - repo: context.repo.repo, - commit_sha: "${{ github.event.workflow_run.head_sha }}", - }); - core.setOutput("message", response.data.message); - core.setOutput("author", response.data.author.name); - core.setOutput("email", response.data.author.email); - - # Only run Percy when it is demanded or we are running the daily build - - name: Enable Percy if X-Needs-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 - - # Only export to kiwi when it is demanded or on develop - - name: Disable Kiwi if not needed - id: kiwi - if: | - github.event.workflow_run.event == 'pull_request' && - !contains(fromJSON(steps.prdetails.outputs.data).labels.*.name, 'X-Send-Kiwi') - run: echo "value=0" >> $GITHUB_OUTPUT - - - name: Generate unique ID 💎 - id: uuid - run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT - - tests: - name: "Run Tests" - needs: prepare - runs-on: ubuntu-latest - permissions: - actions: read - issues: read - pull-requests: read - environment: Cypress - strategy: - fail-fast: false - matrix: - # Run 4 instances in Parallel - runner: [1, 2, 3, 4] - steps: - - uses: browser-actions/setup-chrome@c485fa3bab6be59dce18dbc18ef6ab7cbc8ff5f1 - - 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@v3 - 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: inputs.rust-crypto - run: | - echo "CYPRESS_RUST_CRYPTO=1" >> "$GITHUB_ENV" - - - name: Run Cypress tests - uses: cypress-io/github-action@40a1a26c08d0e549e8516612ecebbd1ab5eeec8f - with: - working-directory: matrix-react-sdk - # The built-in Electron runner seems to grind to a halt trying - # to run the tests, so use chrome. - browser: "${{ env.BROWSER_PATH }}" - start: npx serve -p 8080 ../webapp - wait-on: "http://localhost:8080" - record: true - parallel: true - command-prefix: "yarn percy exec --parallel --" - config: '{"reporter":"cypress-multi-reporters", "reporterOptions": { "configFile": "cypress-ci-reporter-config.json" } }' - ci-build-id: ${{ needs.prepare.outputs.uuid }} - env: - # pass the Dashboard record key as an environment variable - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - - # 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 }} - - # tell Cypress more details about the context of this run - COMMIT_INFO_BRANCH: ${{ github.event.workflow_run.head_branch }} - COMMIT_INFO_SHA: ${{ github.event.workflow_run.head_sha }} - COMMIT_INFO_REMOTE: ${{ github.repositoryUrl }} - COMMIT_INFO_MESSAGE: ${{ needs.prepare.outputs.commit_message }} - COMMIT_INFO_AUTHOR: ${{ needs.prepare.outputs.commit_author }} - COMMIT_INFO_EMAIL: ${{ needs.prepare.outputs.commit_email }} - CYPRESS_PULL_REQUEST_ID: ${{ needs.prepare.outputs.pr_id }} - CYPRESS_PULL_REQUEST_URL: https://github.com/${{ github.repository }}/pull/${{ needs.prepare.outputs.pr_id }} - - # pass the Percy token as an environment variable - PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} - PERCY_ENABLE: ${{ needs.prepare.outputs.percy_enable }} - PERCY_BROWSER_EXECUTABLE: /usr/bin/chromium-browser - # 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 Artifact - if: failure() - uses: actions/upload-artifact@v3 - with: - name: cypress-results - path: | - matrix-react-sdk/cypress/screenshots - matrix-react-sdk/cypress/videos - matrix-react-sdk/cypress/synapselogs - - - name: Upload reports - if: always() - uses: actions/upload-artifact@v3 - with: - name: cypress-junit - path: matrix-react-sdk/cypress/results - - report: - name: Report 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 }} - - kiwi: - name: Report results to kiwi - needs: - - prepare - - tests - environment: Kiwi - runs-on: ubuntu-latest - if: ${{ needs.prepare.outputs.kiwi_enable == '1' }} - steps: - - name: Download all zip files - uses: actions/download-artifact@v3 - with: - name: cypress-junit - - name: Upload to kiwi - uses: vector-im/kiwitcms-upload-action@main - with: - file-pattern: results-*.xml - kiwi-username: ${{ secrets.TCMS_USERNAME }} - kiwi-password: ${{ secrets.TCMS_PASSWORD }} - product: "Element Web" - product-version: ${{ github.event.workflow_run.head_branch }} - build-id: ${{ github.event.workflow_run.head_sha }} - suite-name: "Cypress E2E" - summary-template: "$name" diff --git a/.github/workflows/element-web.yaml b/.github/workflows/element-web.yaml deleted file mode 100644 index d369641f171..00000000000 --- a/.github/workflows/element-web.yaml +++ /dev/null @@ -1,87 +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: - 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@v3 - with: - repository: ${{ inputs.react-sdk-repository || github.repository }} - - - uses: actions/setup-node@v3 - 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/i18n_check.yml b/.github/workflows/i18n_check.yml deleted file mode 100644 index 03dda98eca7..00000000000 --- a/.github/workflows/i18n_check.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: i18n Check -on: - workflow_call: {} -jobs: - check: - runs-on: ubuntu-latest - permissions: - pull-requests: read - steps: - - uses: actions/checkout@v3 - - - name: "Get modified files" - id: changed_files - if: github.event_name == 'pull_request' && github.event.pull_request.user.login != 'RiotTranslateBot' - uses: tj-actions/changed-files@b2d17f51244a144849c6b37a3a6791b98a51d86f # v35 - with: - files: | - src/i18n/strings/* - files_ignore: | - src/i18n/strings/en_EN.json - - - name: "Assert only en_EN was modified" - if: | - github.event_name == 'pull_request' && - github.event.pull_request.user.login != 'RiotTranslateBot' && - steps.changed_files.outputs.any_modified == 'true' - run: | - echo "Only translation files modified by `yarn i18n` can be committed - other translation files will confuse weblate in unrecoverable ways." - exit 1 - - - uses: actions/setup-node@v3 - with: - cache: "yarn" - - # Does not need branch matching as only analyses this layer - - name: Install Deps - run: "yarn install --frozen-lockfile" - - - name: i18n Check - run: "yarn run diff-i18n" diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml deleted file mode 100644 index 248fb50c9ef..00000000000 --- a/.github/workflows/netlify.yaml +++ /dev/null @@ -1,70 +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. - - - id: prdetails - 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 }} - - # 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 - id: netlify - uses: nwtgck/actions-netlify@5da65c9f74c7961c5501a3ba329b8d0912f39c03 # v2.0 - with: - publish-dir: webapp - deploy-message: "Deploy from GitHub Actions" - # These don't work because we're in workflow_run - enable-pull-request-comment: false - enable-commit-comment: false - alias: pr${{ steps.prdetails.outputs.pr_id }} - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - timeout-minutes: 1 - - - name: 🚦 Update deployment status - uses: bobheadxi/deployments@88ce5600046c82542f8246ac287d0a53c461bca3 # v1 - if: always() - with: - step: finish - override: false - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - env: ${{ steps.deployment.outputs.env }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: ${{ steps.netlify.outputs.deploy-url }} - 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 39a252034c3..00000000000 --- 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@26b39ed245ab8f31526069329e112ab2fb224588 # 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 1f49adfcc43..00000000000 --- 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.yml b/.github/workflows/release.yml deleted file mode 100644 index c8b44ef47d2..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Release Process -on: - release: - types: [published] -concurrency: ${{ github.workflow }}-${{ github.ref }} -jobs: - npm: - name: Publish - uses: matrix-org/matrix-js-sdk/.github/workflows/release-npm.yml@develop - secrets: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml deleted file mode 100644 index 1293e6e6656..00000000000 --- 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 c4bf0ef3be7..00000000000 --- a/.github/workflows/static_analysis.yaml +++ /dev/null @@ -1,150 +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@v3 - - - uses: actions/setup-node@v3 - 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" - - tsc-strict: - name: Typescript Strict Error Checker - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - pull-requests: read - checks: write - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install Deps - run: "scripts/ci/layered.sh" - - - name: Get diff lines - id: diff - uses: Equip-Collaboration/diff-line-numbers@e752977e2cb4207d671bb9e4dad18c07c1b73d52 # v1.1.0 - with: - include: '["\\.tsx?$"]' - - - name: Detecting files changed - id: files - uses: futuratrepadeira/changed-files@0239328a3a6268aad16af7c3e4efc78e32d6c0f0 # v4.0.1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pattern: '^.*\.tsx?$' - - - uses: t3chguy/typescript-check-action@main - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - use-check: false - check-fail-mode: added - output-behaviour: annotate - ts-extra-args: "--strict --noImplicitAny" - files-changed: ${{ steps.files.outputs.files_updated }} - files-added: ${{ steps.files.outputs.files_created }} - files-deleted: ${{ steps.files.outputs.files_deleted }} - line-numbers: ${{ steps.diff.outputs.lineNumbers }} - - i18n_lint: - name: "i18n Check" - uses: matrix-org/matrix-react-sdk/.github/workflows/i18n_check.yml@develop - - rethemendex_lint: - name: "Rethemendex Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - run: ./res/css/rethemendex.sh - - - run: git diff --exit-code - - js_lint: - name: "ESLint" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - 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@v3 - - - uses: actions/setup-node@v3 - 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" - - analyse_dead_code: - name: "Analyse Dead Code" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - 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 ad8fdab8c7b..00000000000 --- 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@v3 - with: - repository: ${{ inputs.matrix-js-sdk-sha && 'matrix-org/matrix-react-sdk' || github.repository }} - - - name: Yarn cache - uses: actions/setup-node@v3 - 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@410541432439795d30db6501fb1d8178eb41e502 # v1 - - - 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@v3 - with: - repository: ${{ inputs.matrix-js-sdk-sha && 'matrix-org/matrix-react-sdk' || github.repository }} - - - uses: actions/setup-node@v3 - with: - cache: "yarn" - - - name: Run tests - run: "./scripts/ci/app-tests.sh" - env: - JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} diff --git a/.github/workflows/upgrade_dependencies.yml b/.github/workflows/upgrade_dependencies.yml deleted file mode 100644 index 0263ba9ca5d..00000000000 --- a/.github/workflows/upgrade_dependencies.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Upgrade Dependencies -on: - workflow_dispatch: {} -jobs: - upgrade: - uses: matrix-org/matrix-js-sdk/.github/workflows/upgrade_dependencies.yml@develop - secrets: - ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}