-
Notifications
You must be signed in to change notification settings - Fork 15
81 lines (72 loc) · 2.04 KB
/
ci.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# see https://github.com/sdras/awesome-actions for a good list of available action
name: CI
on:
push:
branches: [master, ci-*]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache packages
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
tests:
name: "${{ matrix.os }}/Node-${{matrix.node-version}}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: [12.x]
# code-version: [stable, insiders]
include:
- os: ubuntu-latest
node-version: 10.x
- os: ubuntu-latest
node-version: 14.x
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build Package
run: |
npm ci
npm run build
# TODO test built grammar files don't change after this?
- name: Run tests
uses: GabrielBB/[email protected]
with:
run: npm test
publish:
# only if all tests complete and the commit is tagged as a release
name: Publish to VS Code Marketplace
needs: [lint, tests]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && contains(github.ref, 'v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- uses: lannonbr/vsce-action@master
with:
args: "publish -p $VSCE_TOKEN"
env:
VSCE_TOKEN: ${{ secrets.VSCE_PUB }}