Skip to content

tests

tests #1121

Workflow file for this run

---
name: tests
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
tests:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Setup
run: |
npm install
- name: Build Extension
run: |
case "$GITHUB_EVENT_NAME" in
push)
VERSION_VALUE=${GITHUB_SHA:0:7};;
pull_request)
VERSION_VALUE=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH");;
*)
VERSION_VALUE="unknown";;
esac
echo $VERSION_VALUE
sed -Ei 's/("version": ")(.+)(",)$/\1\2-'$VERSION_VALUE'\3/' package.json
npm run build:production
- name: Upload Extension
uses: actions/upload-artifact@v2
with:
name: editor-extension
path: editor-*.vsix
- name: Test
run: |
xvfb-run -a npm run test
- name: Upload Code Coverage
uses: codecov/codecov-action@v3
- name: Lint
run: |
npm run lint