Skip to content

Commit

Permalink
Run actions using explicit node version
Browse files Browse the repository at this point in the history
Additionally, run npm with --engine-strict.

This is an attempt to more closely enforce engine requirements and is
related #1068 [1] and #1230 [2].

[1] #1068 (comment)
[2] #1230
  • Loading branch information
badeball committed Sep 19, 2024
1 parent 8b3ec97 commit f7444be
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
matrix:
cypress-version: ${{fromJson(needs.prepare-versions.outputs.matrix)}}
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Checkout
uses: actions/checkout@v4
- name: Cache NPM modules
Expand All @@ -42,22 +45,28 @@ jobs:
env:
CYPRESS_INSTALL_BINARY: "0"
run: |
npm install --force && \
npm install --engine-strict && \
npm install --no-save cypress@${{ matrix.cypress-version }} && \
env -u CYPRESS_INSTALL_BINARY npx cypress install
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Version
run: npx cypress --version
- name: Versions
run: |
npx cypress --version
node --version
npm --version
windows:
runs-on: windows-latest
env:
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm
CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/.cypress
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Checkout
uses: actions/checkout@v4
- name: Cache NPM modules
Expand All @@ -72,11 +81,16 @@ jobs:
key: cypress-windows
- name: Dependencies
shell: bash
run: npm install
run: npm install --engine-strict
- name: Build
run: npm run build
# https://github.com/webpack/webpack/issues/12759
- name: Remove Webpack test
run: rm features/loaders/webpack.feature
- name: Test
run: npm run test:integration
- name: Versions
run: |
npx cypress --version
node --version
npm --version
13 changes: 10 additions & 3 deletions .github/workflows/examples-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- id: set-matrix
name: Prepare
run: echo "matrix=$(node -p "JSON.stringify(fs.readdirSync('examples').filter(f => f !== 'readme.md'))")" >> $GITHUB_OUTPUT
- run: npm -v

build-package:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -69,6 +68,9 @@ jobs:
env:
NPM_CONFIG_PACKAGE_LOCK: "false"
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Checkout
uses: actions/checkout@v4
- name: Cache NPM modules
Expand All @@ -94,10 +96,10 @@ jobs:
path: examples/${{ matrix.example }}
- name: Install NPM modules
working-directory: examples/${{ matrix.example }}
run: npm install
run: npm install --engine-strict
- name: Install dirty build
working-directory: examples/${{ matrix.example }}
run: npm install badeball-*
run: npm install --engine-strict badeball-*
- name: Run Cypress
working-directory: examples/${{ matrix.example }}
run: |
Expand All @@ -106,3 +108,8 @@ jobs:
else
npx cypress run --e2e
fi
- name: Versions
run: |
npx cypress --version
node --version
npm --version
11 changes: 9 additions & 2 deletions .github/workflows/examples-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- id: set-matrix
name: Prepare
run: echo "matrix=$(node -p "JSON.stringify(fs.readdirSync('examples').filter(f => f !== 'readme.md'))")" >> $GITHUB_OUTPUT
- run: npm -v

example:
needs: find-examples
Expand All @@ -33,6 +32,9 @@ jobs:
env:
NPM_CONFIG_PACKAGE_LOCK: "false"
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Checkout
uses: actions/checkout@v4
- name: Cache NPM modules
Expand All @@ -53,7 +55,7 @@ jobs:
rm -rf !(examples)
- name: Install NPM modules
working-directory: examples/${{ matrix.example }}
run: npm install
run: npm install --engine-strict
- name: Run Cypress
working-directory: examples/${{ matrix.example }}
run: |
Expand All @@ -62,3 +64,8 @@ jobs:
else
npx cypress run --e2e
fi
- name: Versions
run: |
npx cypress --version
node --version
npm --version

0 comments on commit f7444be

Please sign in to comment.