Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

CI

CI #190

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
# This is to catch new releases of VS Code which could cause the extension to break
schedule:
- cron: 0 0 * * *
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- run: npm ci
env:
npm_config_arch: x64
- name: Run headless test
uses: coactions/setup-xvfb@v1
with:
run: npm test
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: win32-x64
npm_config_arch: x64
- os: windows-latest
target: win32-arm64
npm_config_arch: arm
- os: ubuntu-latest
target: linux-x64
npm_config_arch: x64
- os: ubuntu-latest
target: linux-arm64
npm_config_arch: arm64
- os: ubuntu-latest
target: linux-armhf
npm_config_arch: arm
- os: ubuntu-latest
target: alpine-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-arm64
npm_config_arch: arm64
- os: ubuntu-latest
target: universal
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- if: matrix.target != 'universal'
name: Install dependencies (with binaries)
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}
- if: matrix.target == 'universal'
name: Install dependencies (without binaries)
run: npm ci
env:
BINDL_SKIP: 'true'
- run: npx semantic-release --extends ./package.release.config.js
env:
VSCE_TARGET: ${{ matrix.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: '*.vsix'
release:
if: github.event_name != 'schedule'
needs: [test, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- run: npm ci
env:
BINDL_SKIP: 'true'
- uses: actions/download-artifact@v4
# Only run on push events or pull requests coming from the same repository, except from dependabot
- 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 && github.actor != 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
docs:
if: github.event_name != 'schedule'
needs: [test, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- run: npm ci
- name: Build docs
run: npm run docs
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: docs