From 0de706a6753ea7432a140abbeb1a2286ada28d07 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Sun, 7 Jul 2024 21:37:39 +0200 Subject: [PATCH] chore: Remove unused GitHub workflows --- .../workflows/end-to-end-tests-netlify.yaml | 43 ---- .github/workflows/end-to-end-tests.yaml | 206 ------------------ .github/workflows/localazy_download.yaml | 10 - .github/workflows/localazy_upload.yaml | 11 - .../workflows/playwright-image-updates.yaml | 45 ---- .github/workflows/publish.yaml | 45 ++++ .github/workflows/release-drafter.yml | 9 - .github/workflows/release-gitflow.yml | 13 -- 8 files changed, 45 insertions(+), 337 deletions(-) delete mode 100644 .github/workflows/end-to-end-tests-netlify.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/playwright-image-updates.yaml create mode 100644 .github/workflows/publish.yaml delete mode 100644 .github/workflows/release-drafter.yml delete mode 100644 .github/workflows/release-gitflow.yml diff --git a/.github/workflows/end-to-end-tests-netlify.yaml b/.github/workflows/end-to-end-tests-netlify.yaml deleted file mode 100644 index a488cbbfb09..00000000000 --- a/.github/workflows/end-to-end-tests-netlify.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# Triggers after the playwright tests have finished, -# taking the artifact and uploading it to Netlify for easier viewing -name: Upload End to End Test report to Netlify -on: - workflow_run: - workflows: ["End to End Tests"] - 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: - report: - if: github.event.workflow_run.conclusion != 'cancelled' - name: Report results - runs-on: ubuntu-latest - environment: Netlify - permissions: - statuses: write - deployments: write - steps: - - name: Download HTML report - uses: actions/download-artifact@v4 - with: - github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - name: html-report - path: playwright-report - - - name: 📤 Deploy to Netlify - uses: matrix-org/netlify-pr-preview@v3 - with: - path: playwright-report - 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 }} - desc: Playwright Report - deployment_env: EndToEndTests - prefix: "e2e-" diff --git a/.github/workflows/end-to-end-tests.yaml b/.github/workflows/end-to-end-tests.yaml deleted file mode 100644 index b663948254b..00000000000 --- a/.github/workflows/end-to-end-tests.yaml +++ /dev/null @@ -1,206 +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 end-to-end tests. -name: End to End Tests -on: - 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: - skip: - type: boolean - required: false - default: false - description: "A boolean to skip the playwright check itself while still creating the passing check. Useful when only running in Merge Queues." - - 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." - element-web-sha: - type: string - required: false - description: "The Git SHA of element-web 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 - if: inputs.skip != true - 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 & EW, if they were given one - JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} - ELEMENT_WEB_GITHUB_BASE_REF: ${{ inputs.element-web-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 - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: webapp - path: element-web/webapp - retention-days: 1 - - playwright: - name: "Run Tests ${{ matrix.runner }}/${{ strategy.job-total }}" - needs: build - if: inputs.skip != true - runs-on: ubuntu-latest - permissions: - actions: read - issues: read - pull-requests: read - strategy: - fail-fast: false - matrix: - # Run multiple instances in parallel to speed up the tests - runner: [1, 2, 3, 4, 5, 6, 7, 8] - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - path: matrix-react-sdk - repository: ${{ inputs.react-sdk-repository || github.repository }} - - - name: 📥 Download artifact - uses: actions/download-artifact@v4 - with: - name: webapp - path: webapp - - - uses: actions/setup-node@v4 - 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: Get installed Playwright version - id: playwright - working-directory: matrix-react-sdk - run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_OUTPUT - - - name: Cache playwright binaries - uses: actions/cache@v4 - id: playwright-cache - with: - path: | - ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ steps.playwright.outputs.version }} - - - name: Install Playwright browsers - if: steps.playwright-cache.outputs.cache-hit != 'true' - working-directory: matrix-react-sdk - run: yarn playwright install --with-deps - - - name: Run Playwright tests - uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a - 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@v4 - with: - name: all-blob-reports-${{ matrix.runner }} - path: matrix-react-sdk/blob-report - retention-days: 1 - - complete: - name: end-to-end-tests - needs: playwright - if: always() - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - if: inputs.skip != true - with: - persist-credentials: false - repository: ${{ inputs.react-sdk-repository || github.repository }} - - - uses: actions/setup-node@v4 - if: inputs.skip != true - with: - cache: "yarn" - - - name: Install dependencies - if: inputs.skip != true - run: yarn install --frozen-lockfile - - - name: Download blob reports from GitHub Actions Artifacts - if: inputs.skip != true - uses: actions/download-artifact@v4 - with: - pattern: all-blob-reports-* - path: all-blob-reports - merge-multiple: true - - - name: Merge into HTML Report - if: inputs.skip != true - run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts ./all-blob-reports - env: - # Only pass creds to the flaky-reporter on main branch runs - GITHUB_TOKEN: ${{ github.event.workflow_run.head_branch == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }} - - - name: Upload HTML report - if: inputs.skip != true - uses: actions/upload-artifact@v4 - with: - name: html-report - path: playwright-report - retention-days: 14 - - - if: needs.playwright.result != 'skipped' && needs.playwright.result != 'success' - run: exit 1 diff --git a/.github/workflows/localazy_download.yaml b/.github/workflows/localazy_download.yaml deleted file mode 100644 index a880c3b2e40..00000000000 --- 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 9ba79800dbd..00000000000 --- 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/playwright-image-updates.yaml b/.github/workflows/playwright-image-updates.yaml deleted file mode 100644 index 15bea28e0f9..00000000000 --- a/.github/workflows/playwright-image-updates.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Update Playwright docker images -on: - workflow_dispatch: {} - schedule: - - cron: "0 6 * * *" # Every day at 6am UTC -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Update matrixdotorg/synapse image - run: | - docker pull "$IMAGE" - INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE") - DIGEST=${INSPECT#*@} - sed -i "s/const DOCKER_TAG.*/const DOCKER_TAG = \"develop@$DIGEST\";/" playwright/plugins/homeserver/synapse/index.ts - env: - IMAGE: matrixdotorg/synapse:develop - - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5 - with: - token: ${{ secrets.ELEMENT_BOT_TOKEN }} - branch: actions/playwright-image-updates - delete-branch: true - title: Playwright Docker image updates - labels: | - T-Task - - - name: Enable automerge - run: gh pr merge --merge --auto "$PR_NUMBER" - if: steps.cpr.outputs.pull-request-operation == 'created' - env: - GH_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} - - - name: Enable autoapprove - run: | - gh pr review --approve "$PR_NUMBER" - if: steps.cpr.outputs.pull-request-operation == 'created' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000000..5496a5204af --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,45 @@ +name: Build && Push + +# Controls when the action will run. +on: + push: + branches: + - master + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create image tags + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/scicatproject/matrix-react-sdk + flavor: latest=true # adds :latest tag to outputs.tags + tags: type=sha,format=long,prefix= # adds : tag to outputs.tags + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index d8afa80a9f9..00000000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Release Drafter -on: - push: - branches: [staging] - workflow_dispatch: {} -concurrency: ${{ github.workflow }} -jobs: - draft: - uses: matrix-org/matrix-js-sdk/.github/workflows/release-drafter-workflow.yml@develop diff --git a/.github/workflows/release-gitflow.yml b/.github/workflows/release-gitflow.yml deleted file mode 100644 index b515bb4cc18..00000000000 --- 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