-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (62 loc) · 1.73 KB
/
build.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
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
deployments: read
packages: none
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- name: Checkout Branch
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: '16.20.1'
- name: Build Extension
run: |
npm install
npm run compile
- name: Smoke test (Linux)
run: xvfb-run -a npm run test
if: runner.os == 'Linux'
- name: Smoke test (Mac, Windows)
run: npm run test
if: runner.os != 'Linux'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@def81595a67c83cbb0a42ba9b624b97f4c7deb3d #v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Package Extension
if: matrix.os == 'ubuntu-latest'
run: |
npm install -g vsce
vsce package
mkdir vsix
mv *.vsix vsix
- name: Archive Extension
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@3446296876d12d4e3a0f3145a3c87e67bf0a16b5 # v1.0.0
with:
name: vsix
path: vsix