diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index f95be8b..fd40fe5 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -83,29 +83,3 @@ jobs: echo "Working tree dirty at end of job" exit 1 fi - - compatibility-test: - name: Compatibility test - needs: prepare - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - steps: - - name: Checkout and setup environment - uses: MetaMask/action-checkout-and-setup@v1 - with: - is-high-risk-environment: false - node-version: ${{ matrix.node-version }} - - name: Install dependencies via Yarn - run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn - - run: yarn test - - name: Restore lockfile - run: git restore yarn.lock - - name: Require clean working directory - shell: bash - run: | - if ! git diff --exit-code; then - echo "Working tree dirty at end of job" - exit 1 - fi diff --git a/.github/workflows/compatibility-test.yml b/.github/workflows/compatibility-test.yml new file mode 100644 index 0000000..f7a58c6 --- /dev/null +++ b/.github/workflows/compatibility-test.yml @@ -0,0 +1,25 @@ +name: Compatibility Test + +on: + workflow_call: + +jobs: + compatibility-test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + steps: + - uses: MetaMask/action-checkout-and-setup@v1 + with: + is-high-risk-environment: false + node-version: ${{ matrix.node-version }} + - run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn + - run: yarn test + - run: git restore yarn.lock + - shell: bash + run: | + if ! git diff --exit-code; then + echo "Working tree dirty at end of job" + exit 1 + fi diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 730eb92..ee23e9c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,11 @@ jobs: name: Build, lint, and test uses: ./.github/workflows/build-lint-test.yml + compatibility-test: + name: Compatibility test + uses: ./.github/workflows/compatibility-test.yml + if: ${{ github.ref == 'refs/heads/main' }} + all-jobs-completed: name: All jobs completed runs-on: ubuntu-latest