-
Notifications
You must be signed in to change notification settings - Fork 26
41 lines (38 loc) · 1.35 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Test
on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master
jobs:
npmtest:
name: Run npm tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read .nvmrc
# See <https://remarkablemark.org/blog/2021/03/11/setup-nodejs-with-nvmrc-in-github-actions/>
# # And <https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter>
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
- name: Install node modules as specified in lockfile
run: npm ci
- name: Install latest vg release
# See https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8 for how we pull out the right URL
run: |
mkdir -p bin
curl -sSL "$(curl -sSL https://api.github.com/repos/vgteam/vg/releases/latest | grep 'browser_download_url.*vg"' | cut -d ':' -f 2,3 | tr -d '"' | sed 's/^ *//g')" >bin/vg
chmod +x bin/vg
- name: Run tests
run: PATH=$PATH:$(pwd)/bin CI=true npm run test
- name: Test build
run: npm run build