feat: add CI #2
Workflow file for this run
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] | |
paths-ignore: | |
- "**/*.md" | |
- "CODEOWNERS" | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- "**/*.md" | |
- "CODEOWNERS" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
node-version: [18.x, 20.x] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Compile | |
run: npm run compile | |
- name: Run tests | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: npm test | |
package: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Install vsce | |
run: npm install -g @vscode/vsce | |
- name: Package Extension | |
run: vsce package | |
- name: Upload Extension Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: extension-package | |
path: "*.vsix" |