Skip to content

chore: update test configuration and add CI setup documentation #1

chore: update test configuration and add CI setup documentation

chore: update test configuration and add CI setup documentation #1

Workflow file for this run

name: CI Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test Extension
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18.x]
vscode-version: [stable, insiders]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.11.0
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm run lint
- name: Compile
run: pnpm run compile
# Run tests on Linux
- name: Run tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a pnpm test
env:
VSCODE_VERSION: ${{ matrix.vscode-version }}
# Run tests on macOS and Windows
- name: Run tests (macOS/Windows)
if: runner.os != 'Linux'
run: pnpm test
env:
VSCODE_VERSION: ${{ matrix.vscode-version }}
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}-${{ matrix.vscode-version }}
path: .vscode-test/
if-no-files-found: ignore
build:
name: Build Extension Package
needs: test
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/main'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.11.0
run_install: false
- name: Install dependencies
run: pnpm install
- name: Package Extension
run: pnpm run package
- name: Upload Extension Package
uses: actions/upload-artifact@v3
with:
name: extension-package
path: '*.vsix'