Skip to content

sample

sample #18

Workflow file for this run

name: ' 🧪 Test Windows'
on:
push:
branches:
- test-1222
workflow_dispatch:
jobs:
test-os:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
# - 18.x
- 20.x
# - 22.x
# - 23.x
os:
- windows-latest
# - macos-latest # Smoke test is enough for now.
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.2.0
with:
registry-url: 'https://registry.npmjs.org'
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Check location of corepack before removing hostedtoolcache
run: |
C:\Windows\System32\where.exe corepack
- name: Check corepack version before removal
run: |
corepack --version
- name: Get exact Node.js version
id: node-version
run: echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV
shell: bash
- name: Clear hosted tool cache
run: |
$nodeVersion = $env:NODE_VERSION.TrimStart('v')
Remove-Item -Force "C:\hostedtoolcache\windows\node\$nodeVersion\x64\corepack*"
shell: pwsh
# - name: Check corepack version after removal
# run: |
# corepack --version
# - name: Check location of corepack after removing hostedtoolcache
# run: |
# C:\Windows\System32\where.exe corepack
- name: Enable Corepack
run: |
# npm i -g --force corepack
# corepack enable
& "C:\Program Files\nodejs\corepack.cmd" --version
- name: Check location of corepack after global install
run: |
C:\Windows\System32\where.exe corepack
- name: Install dependencies
run: pnpm install
- name: Check pnpm version
run: pnpm -v