-
Notifications
You must be signed in to change notification settings - Fork 6
137 lines (137 loc) · 3.65 KB
/
integration.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Integration
on:
push: {branches: [main]}
pull_request: {branches: [main]}
jobs:
validate:
name: Validate
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: latest
check-latest: true
cache: pnpm
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.x
check-latest: true
- name: Install VisualStudio
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Install Tools
run: |
addpath() { export PATH="$1:$PATH" && echo "$1" >> $GITHUB_PATH ; }
case "$RUNNER_OS" in
Linux)
sudo apt update
sudo apt install -y ninja-build
;;
macOS)
brew install llvm ninja
addpath "$(brew --prefix llvm)/bin"
;;
Windows)
choco install ninja
;;
*)
echo "Unknown OS: $RUNNER_OS"
exit 1
;;
esac
- name: Check Environment
run: |
trace() { echo "::group::$@" && "$@" && echo "::endgroup::" ; }
trace node --version
trace python --version
trace clang --version
trace clang++ --version
trace clang-format --version
trace clang-tidy --version
trace ninja --version
- name: Setup Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('addon/deps.json') }}
path: addon/gn
- name: Prepare Dependencies
run: pnpm install --frozen-lockfile
- name: Build Debug
run: pnpm debug
- name: Run Test
run: pnpm test
- name: Build Release
run: pnpm build
- name: Upload Archive
uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' }}
with:
name: archive
path: |
README.md
CHANGELOG.md
LICENSE
package.json
build
!build/*.node
- name: Upload Addons
uses: actions/upload-artifact@v3
with:
name: addons
path: build/*.node
build:
name: Build
needs: validate
runs-on: ubuntu-latest
steps:
- name: Install Tools
run: npm install --global @vscode/vsce
- name: Download Archive
uses: actions/download-artifact@v3
with:
name: archive
path: .
- name: Download Addons
uses: actions/download-artifact@v3
with:
name: addons
path: build
- name: Generate Package
run: vsce package --out gnls.vsix
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: package
path: gnls.vsix
publish:
name: Publish
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Install Tools
run: npm install --global @vscode/vsce
- name: Download Package
uses: actions/download-artifact@v3
with:
name: package
path: .
- name: Publish Package
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: vsce publish --skip-duplicate --packagePath gnls.vsix