π #1324 #242
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 | |
# Build VSIX packages in production and debug mode. | |
# Run tests against debug build. | |
# | |
# This workflow is designed to be run on pushing to master branch. | |
on: | |
push: | |
branches: [master] | |
paths: | |
- ".github/workflows/*.yml" | |
- "src/**" | |
- "syntaxes/**" | |
- ".*" | |
- "package*.json" | |
- "tsconfig.json" | |
- "webpack.*" | |
- "!**.md" | |
workflow_dispatch: | |
repository_dispatch: | |
types: ["package"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Setup Node.js environment" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
cache: "npm" | |
- name: "Install dependencies" | |
run: | | |
npm ci | |
npm install -g vsce@"^2.5" | |
# Our prepublish script runs in production mode by default. | |
# We should run tests against debug build to make error messages as useful as possible. | |
- name: "Build" | |
shell: pwsh | |
run: | | |
vsce package --pre-release | |
$env:NODE_ENV = 'development' | |
vsce package --pre-release --out debug.vsix | |
- name: Test | |
uses: GabrielBB/xvfb-action@v1.0 | |
with: | |
run: npm test | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Markdown-All-in-One-${{ github.sha }} | |
path: ./*.vsix | |
# If the run failed, npm log may help to diagnose. | |
- name: "(debug) Upload npm log" | |
if: ${{ !success() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "npm-debug-log" | |
path: "~/.npm/_logs" |