-
Notifications
You must be signed in to change notification settings - Fork 10
66 lines (55 loc) · 1.53 KB
/
pr.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: Pull request
on:
pull_request:
branches:
- main
permissions:
pull-requests: read
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
targets: "darwin-x64,darwin-arm64"
- os: ubuntu-latest
targets: "linux-x64,linux-arm64"
- os: windows-latest
targets: "win32-x64"
fail-fast: false
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install node 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- name: Cache vscode-test folder
uses: actions/cache@v4
with:
path: .vscode-test
key: ${{ runner.os }}-vscode-test-${{ hashFiles('package.json') }}
- name: Install project modules
run: npm ci
- name: Lint project
run: npm run lint
- name: Run tests linux
if: runner.os == 'Linux'
run: xvfb-run -a npm test
- name: Run tests non-linux
if: runner.os != 'Linux'
run: npm test
- name: Verify coverage
run: npm run cov
- name: Create a VSIX package for targets [ ${{ matrix.targets }} ]
shell: bash
run: >
echo "${{ matrix.targets }}" | tr "," "\n" | while read -r target; do
npm run vsce:package -- \
--target ${target} \
--out ocm-vscode-extension-${target}-dev.vsix
done