From 9b303aec0bb24b4bf63d4d4b7dbc7c9c1fe7bdfb Mon Sep 17 00:00:00 2001 From: DaMandal0rian Date: Mon, 6 May 2024 23:30:37 +0300 Subject: [PATCH] remove unused workflows --- .github/workflows/checks.yml | 228 ---------------------------- .github/workflows/deploy-review.yml | 59 ------- .github/workflows/publish-image.yml | 84 ---------- 3 files changed, 371 deletions(-) delete mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/deploy-review.yml delete mode 100644 .github/workflows/publish-image.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 9496bb37e6..0000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,228 +0,0 @@ -name: Checks -on: - workflow_call: - workflow_dispatch: - pull_request: - types: [ opened, synchronize, unlabeled ] - paths-ignore: - - '.github/ISSUE_TEMPLATE/**' - - '.husky/**' - - '.vscode/**' - - 'deploy/**' - - 'docs/**' - - 'public/**' - - 'stub/**' - - 'tools/**' - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - code_quality: - name: Code quality - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip checks') && !(github.event.action == 'unlabeled' && github.event.label.name != 'skip checks') }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run ESLint - run: yarn lint:eslint - - - name: Compile TypeScript - run: yarn lint:tsc - - envs_validation: - name: ENV variables validation - runs-on: ubuntu-latest - needs: [ code_quality ] - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Install script dependencies - run: cd ./deploy/tools/envs-validator && yarn --frozen-lockfile --ignore-optional - - - name: Run validation tests - run: | - set +e - cd ./deploy/tools/envs-validator && yarn test - exitcode="$?" - echo "exitcode=$exitcode" >> $GITHUB_OUTPUT - exit "$exitcode" - - jest_tests: - name: Jest tests - needs: [ code_quality, envs_validation ] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run Jest - run: yarn test:jest ${{ github.event_name == 'pull_request' && '--changedSince=origin/main' || '' }} --passWithNoTests - - pw_affected_tests: - name: Resolve affected Playwright tests - runs-on: ubuntu-latest - needs: [ code_quality, envs_validation ] - if: github.event_name == 'pull_request' - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Install script dependencies - run: cd ./deploy/tools/affected-tests && yarn --frozen-lockfile - - - name: Run script - run: yarn test:pw:detect-affected - - - name: Upload result file - uses: actions/upload-artifact@v4 - with: - name: playwright-affected-tests - path: ./playwright/affected-tests.txt - retention-days: 3 - - pw_tests: - name: 'Playwright tests / Project: ${{ matrix.project }}' - needs: [ code_quality, envs_validation, pw_affected_tests ] - if: | - always() && - needs.code_quality.result == 'success' && - needs.envs_validation.result == 'success' && - (needs.pw_affected_tests.result == 'success' || needs.pw_affected_tests.result == 'skipped') - runs-on: ubuntu-latest - container: - image: mcr.microsoft.com/playwright:v1.41.1-focal - - strategy: - fail-fast: false - matrix: - project: [ default, mobile, dark-color-mode ] - - steps: - - name: Install git-lfs - run: apt-get update && apt-get install git-lfs - - - name: Checkout repo - uses: actions/checkout@v4 - with: - lfs: 'true' - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Download affected tests list - if: ${{ needs.pw_affected_tests.result == 'success' }} - uses: actions/download-artifact@v4 - continue-on-error: true - with: - name: playwright-affected-tests - path: ./playwright - - - name: Run PlayWright - run: yarn test:pw:ci --affected=${{ github.event_name == 'pull_request' }} --pass-with-no-tests - env: - HOME: /root - PW_PROJECT: ${{ matrix.project }} - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: playwright-report-${{ matrix.project }} - path: playwright-report - retention-days: 10 \ No newline at end of file diff --git a/.github/workflows/deploy-review.yml b/.github/workflows/deploy-review.yml deleted file mode 100644 index 64bc517804..0000000000 --- a/.github/workflows/deploy-review.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Deploy review environment - -on: - workflow_dispatch: - inputs: - envs_preset: - description: ENVs preset - required: false - default: "" - type: choice - options: - - none - - base - - gnosis - - eth - - eth_sepolia - - eth_goerli - - optimism - - optimism_sepolia - - polygon - - rootstock - - stability - - zkevm - - zksync - -jobs: - make_slug: - name: Make GitHub reference slug - runs-on: ubuntu-latest - outputs: - REF_SLUG: ${{ steps.output.outputs.REF_SLUG }} - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4.4.1 - - - name: Set output - id: output - run: echo "REF_SLUG=${{ env.GITHUB_REF_NAME_SLUG }}" >> $GITHUB_OUTPUT - - publish_image: - name: Publish Docker image - needs: make_slug - uses: './.github/workflows/publish-image.yml' - with: - tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }} - build_args: ENVS_PRESET=${{ inputs.envs_preset }} - secrets: inherit - - deploy_review: - name: Deploy frontend - needs: [ make_slug, publish_image ] - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: review-${{ needs.make_slug.outputs.REF_SLUG }} - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml deleted file mode 100644 index 97c1102e8f..0000000000 --- a/.github/workflows/publish-image.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Publish Docker image - -on: - workflow_dispatch: - inputs: - tags: - description: Image tags - required: false - type: string - build_args: - description: Build-time variables - required: false - type: string - platforms: - description: Image platforms (you can specify multiple platforms separated by comma) - required: false - type: string - default: linux/amd64 - workflow_call: - inputs: - tags: - description: Image tags - required: false - type: string - build_args: - description: Build-time variables - required: false - type: string - platforms: - description: Image platforms (you can specify multiple platforms separated by comma) - required: false - type: string - default: linux/amd64 - -jobs: - run: - name: Run - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - # Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/blockscout/frontend - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Add SHORT_SHA env property with commit short sha - run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - - - name: Debug - env: - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} - run: | - echo "ref_type: $REF_TYPE" - echo "ref_name: $REF_NAME" - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - cache-from: type=gha - tags: ${{ inputs.tags || steps.meta.outputs.tags }} - platforms: ${{ inputs.platforms }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - GIT_COMMIT_SHA=${{ env.SHORT_SHA }} - GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} - ${{ inputs.build_args }} \ No newline at end of file