ci(ci): ensure node.js path on windows runner #10
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-check: | |
| name: Build Check (${{ matrix.os }}) | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.7.5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Verify Node.js | |
| shell: bash | |
| run: node --version | |
| - name: Setup Node.js PATH (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $nodePath = (Get-Command node).Source | |
| $nodeDir = Split-Path -Parent $nodePath | |
| echo "$nodeDir" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| echo "Added to PATH: $nodeDir" | |
| node --version | |
| - name: Format check | |
| shell: bash | |
| run: deno fmt --check src/ | |
| - name: Lint | |
| run: deno lint src/ | |
| - name: Type check | |
| run: deno check src/index.ts | |
| - name: Test | |
| run: deno test --allow-read --allow-env --allow-run |