diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index 0e8f3ddde2..eb89dec8e2 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -190,8 +190,13 @@ jobs: name: build-source-${{ runner.os }}-${{ github.sha }} - name: Install Google Chrome if: ${{ matrix.package-name == '@metamask/snaps-controllers' || matrix.package-name == '@metamask/snaps-execution-environments' || matrix.package-name == '@metamask/snaps-utils' }} - run: yarn install-chrome - - run: yarn workspace ${{ matrix.package-name }} run test + uses: MetaMask/action-retry-command@v1 + with: + command: yarn install-chrome + - name: Run tests + uses: MetaMask/action-retry-command@v1 + with: + command: yarn workspace ${{ matrix.package-name }} run test - name: Get coverage folder id: get-coverage-folder run: | @@ -260,8 +265,10 @@ jobs: name: build-source-${{ runner.os }}-${{ github.sha }} - name: Build snap run: yarn workspace ${{ matrix.package-name }} run build - - name: Run E2E test - run: yarn workspace ${{ matrix.package-name }} run test + - name: Run E2E tests + uses: MetaMask/action-retry-command@v1 + with: + command: yarn workspace ${{ matrix.package-name }} run test - name: Require clean working directory shell: bash run: | @@ -282,5 +289,9 @@ jobs: uses: MetaMask/action-checkout-and-setup@v1 with: is-high-risk-environment: false - - run: yarn build:ci - - run: yarn workspace @metamask/snaps-cli run test + - name: Build dependencies + run: yarn build:ci + - name: Run tests + uses: MetaMask/action-retry-command@v1 + with: + command: yarn workspace @metamask/snaps-cli run test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27b711d263..b886bb3788 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -117,17 +117,3 @@ jobs: if [[ $passed != "true" ]]; then exit 1 fi - - re-run: - name: Re-run failed jobs - needs: lint-build-test - if: failure() && fromJSON(github.run_attempt) < 3 && github.event.pull_request.user.login != 'dependabot[bot]' && github.event_name != 'merge_group' - runs-on: ubuntu-latest - permissions: - actions: write - steps: - - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ github.token }} - GH_DEBUG: api - run: gh workflow run re-run.yml -F run-id=${{ github.run_id }} diff --git a/.github/workflows/re-run.yml b/.github/workflows/re-run.yml deleted file mode 100644 index fab20184ee..0000000000 --- a/.github/workflows/re-run.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Re-run failed jobs - -on: - workflow_dispatch: - inputs: - run-id: - required: true - -jobs: - re-run: - name: Re-run failed jobs (${{ inputs.run-id }}) - runs-on: ubuntu-latest - permissions: - actions: write - steps: - - name: Re-run ${{ inputs.run-id }} - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ github.token }} - run: | - gh run watch ${{ inputs.run-id }} > /dev/null 2>&1 - gh run rerun ${{ inputs.run-id }} --failed