-
Notifications
You must be signed in to change notification settings - Fork 40
104 lines (89 loc) · 2.68 KB
/
vscode-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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: vscode-ci
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: 'setup node: ${{ matrix.node-version }} platform: ${{ matrix.os }}'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: setup linux
if: runner.os == 'Linux'
run: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo ">>> Started xvfb";
wget https://apt.puppetlabs.com/puppet8-release-jammy.deb;
sudo dpkg -i puppet8-release-jammy.deb;
sudo apt-get update -y;
sudo apt-get install pdk -y;
pdk --version;
- name: setup macos
if: runner.os == 'macOS'
run: |
export HOMEBREW_NO_AUTO_UPDATE=1;
brew install --cask puppetlabs/puppet/pdk;
/opt/puppetlabs/pdk/bin/pdk --version;
- name: setup windows
if: runner.os == 'Windows'
run: |
choco install pdk -y
- name: Install psake
shell: pwsh
run: Install-Module -Name psake -RequiredVersion 4.9.0 -Force
- name: npm install
shell: pwsh
run: |
npm install -g vsce --silent;
npm install --silent;
- name: Run ESLint
run: npm run lint
- name: npm build
shell: pwsh
run: |
invoke-psake -taskList 'build'
- name: npm test
env:
BUILD_VERSION: '0.99.${{ github.event.number }}'
VSCODE_BUILD_VERBOSE: true
DISPLAY: ':99.0'
run: |
npm run test:coverage
- name: Upload Coverage
if: |
runner.os == 'Linux' &&
env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
- name: vsce package
if: runner.os == 'Linux'
env:
BUILD_VERSION: '0.99.${{ github.event.number }}'
shell: pwsh
run: |
invoke-psake -properties @{ packageVersion = $env:BUILD_VERSION } -tasklist bump
mkdir artifacts
vsce package --out artifacts/puppet-vscode-$env:BUILD_VERSION.vsix
- name: upload vsix
if: runner.os == 'Linux'
uses: actions/upload-artifact@master
with:
name: 'puppet-vscode'
path: artifacts