docs: Updating GH actions to Node 20 #50
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] | |
pull_request: | |
branches: [main] | |
# This is to catch new releases of VS Code which could cause the extension to break | |
# Check every Sunday at 12 AM | |
schedule: | |
- cron: 0 0 * * 0 | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
vscode-version: ["1.90.0", stable] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache npm dependencies | |
uses: actions/cache@v4 | |
with: | |
path: "~/.npm" | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm ci | |
env: | |
npm_config_arch: x64 | |
- name: Test with VS Code ${{ matrix.vscode-version }} | |
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a | |
env: | |
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }} | |
with: | |
run: npm test | |
build: | |
permissions: | |
contents: write | |
packages: write | |
if: github.event_name == 'push' | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache npm dependencies | |
uses: actions/cache@v4 | |
with: | |
path: "~/.npm" | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies (without binaries) | |
run: | | |
npm ci | |
- run: npx semantic-release --extends ./package.release.config.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: "*.vsix" | |
release: | |
permissions: | |
contents: write | |
packages: write | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
needs: [test, build] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache npm dependencies | |
uses: actions/cache@v4 | |
with: | |
path: "~/.npm" | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- uses: actions/download-artifact@v4 | |
- run: npx semantic-release --extends ./publish.release.config.js | |
if: github.event_name == 'push' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
OVSX_PAT: ${{ secrets.OVSX_PAT }} |