Add CI pipeline for VS Code extension #1
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: VS Code Extension CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| ci: | |
| name: Build, Test & Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run tests | |
| run: | | |
| if npm run | grep -q test; then | |
| npm test | |
| else | |
| echo "No tests found, skipping..." | |
| fi | |
| - name: Build extension | |
| run: npm run build | |
| - name: Install vsce | |
| run: npm install -g @vscode/vsce | |
| - name: Package VSIX | |
| run: vsce package | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vscode-extension | |
| path: "*.vsix" |