Skip to content

streamlined build to deployment pipeline #37

streamlined build to deployment pipeline

streamlined build to deployment pipeline #37

Workflow file for this run

name: CI
on:
push:
branches: [ main, master, debug-and-decorators ]
pull_request:
branches: [ main, master, debug-and-decorators ]
jobs:
lint-and-unit:
name: Lint and Unit Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run unit tests
run: npm run test:unit
- name: Run tests via batch script (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
continue-on-error: true
run: |
if exist run_tests.bat (
call run_tests.bat
if exist project_logs.log (
echo "=== Test logs ==="
type project_logs.log
)
)
vscode-tests-and-package:
name: VS Code integration tests and package
needs: lint-and-unit
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Run VS Code integration tests
env:
CI: true
VSCODE_VERSION: insiders
run: npm run test:integration
- name: Package VSIX
run: npm run package:vsix
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: blinter-vsix
path: blinter.vsix
publish-release:
name: Publish VSIX to GitHub Release
needs: vscode-tests-and-package
# Only publish on tag pushes (release tags). This avoids publishing from every push/PR.
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download VSIX artifact
uses: actions/download-artifact@v4
with:
name: blinter-vsix
path: .
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: blinter.vsix
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}