Run compatibility checks only in main branch. #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compatibility Test | ||
on: | ||
workflow_call: | ||
inputs: | ||
enabled: | ||
required: false | ||
type: boolean | ||
default: true | ||
jobs: | ||
enabled-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Skipping compatibility test | ||
if: !inputs.enabled | ||
run: echo "Skipping compatibility test" | ||
compatibility-test: | ||
needs: enabled-check | ||
if: inputs.enabled | ||
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 |