Update CI setup and enable Dependabot #114
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
# Adapted from https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions | |
name: Tests and publishing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
release: | |
types: | |
- created | |
jobs: | |
tests: | |
name: Tests ${{ matrix.os }} - Node ${{ matrix.node }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
node: | |
- 18.x | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Compile | |
run: npm install && npm run compile | |
- name: Run tests on Linux with xvfb-run | |
run: xvfb-run -a npm test | |
if: runner.os == 'Linux' | |
- name: Run tests on Windows or macOS | |
run: npm test | |
if: runner.os != 'Linux' | |
publishRelease: | |
name: Publish Release | |
needs: [tests] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create package | |
run: | | |
npm install | |
npm run compile | |
npm run package | |
- name: Publish Release to VS Code Marketplace | |
if: "!github.event.release.prerelease" | |
run: npm run publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- name: Upload package to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: '*.vsix' |