feat: npm-test action (#2) #9
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: npm-test | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
include: | |
# - os: windows-latest # snapshots are different on Windows, so this should be disabled | |
- os: ubuntu-latest | |
- os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
cache-dependency-path: ./vscode-extension | |
- uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- run: npm ci | |
working-directory: ./vscode-extension | |
- run: xvfb-run -a npm test | |
working-directory: ./vscode-extension | |
if: runner.os == 'Linux' | |
- run: npm test | |
working-directory: ./vscode-extension | |
if: runner.os != 'Linux' |