fix(tests): Avoid Node v22.12.0 on Windows (#402) #992
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
test-individual: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
node: [ 18, 20, 22 ] | |
project: | |
[ | |
activities-examples, | |
mutex, | |
nestjs-exchange-rates, | |
timer-examples | |
] | |
include: | |
- os: windows-latest | |
node: 22 | |
node-release-override: 22.11.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
# Node 22.12.0 on Windows incorrectly resolves `localhost` to `::1`, rather than both `::1` and `127.0.0.1`. | |
# THis causes errors when executing tests. So until this gets fixed upstream, we force the last known good | |
# version of Node on Windows. | |
# See https://github.com/nodejs/node/issues/56137 (_resolved_ already, but not yet released). | |
node-version: ${{ matrix.node-release-override || matrix.node }} | |
# Comment out cache line when testing with act: | |
# (Test command is: act --platform ubuntu-latest=lucasalt/act_base:latest) | |
cache: 'pnpm' | |
- run: pnpm install | |
working-directory: ${{ matrix.project }} | |
- run: npm run build | |
working-directory: ${{ matrix.project }} | |
- run: npm test | |
working-directory: ${{ matrix.project }} | |
lint-format-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- run: pnpm install | |
- run: pnpm lint | |
- run: pnpm format:check | |
- run: pnpm build |