Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 45ed998

Browse files
authored
Run compatibility test only in main branch. (#397)
Moved the compatibility test into it's own workflow. This implements the change described here MetaMask/metamask-module-template#269, ensuring that the compatibility test continues to provide value in identifying issues, but does not hold up individual PRs that do not introduce these issues.
1 parent d2578c5 commit 45ed998

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

.github/workflows/build-lint-test.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,3 @@ jobs:
8383
echo "Working tree dirty at end of job"
8484
exit 1
8585
fi
86-
87-
compatibility-test:
88-
name: Compatibility test
89-
needs: prepare
90-
runs-on: ubuntu-latest
91-
strategy:
92-
matrix:
93-
node-version: [18.x, 20.x, 22.x]
94-
steps:
95-
- name: Checkout and setup environment
96-
uses: MetaMask/action-checkout-and-setup@v1
97-
with:
98-
is-high-risk-environment: false
99-
node-version: ${{ matrix.node-version }}
100-
- name: Install dependencies via Yarn
101-
run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
102-
- run: yarn test
103-
- name: Restore lockfile
104-
run: git restore yarn.lock
105-
- name: Require clean working directory
106-
shell: bash
107-
run: |
108-
if ! git diff --exit-code; then
109-
echo "Working tree dirty at end of job"
110-
exit 1
111-
fi
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Compatibility Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
compatibility-test:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node-version: [18.x, 20.x, 22.x]
12+
steps:
13+
- uses: MetaMask/action-checkout-and-setup@v1
14+
with:
15+
is-high-risk-environment: false
16+
node-version: ${{ matrix.node-version }}
17+
- run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
18+
- run: yarn test
19+
- run: git restore yarn.lock
20+
- shell: bash
21+
run: |
22+
if ! git diff --exit-code; then
23+
echo "Working tree dirty at end of job"
24+
exit 1
25+
fi

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
name: Build, lint, and test
3939
uses: ./.github/workflows/build-lint-test.yml
4040

41+
compatibility-test:
42+
name: Compatibility test
43+
uses: ./.github/workflows/compatibility-test.yml
44+
if: ${{ github.ref == 'refs/heads/main' }}
45+
4146
all-jobs-completed:
4247
name: All jobs completed
4348
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)