-
Notifications
You must be signed in to change notification settings - Fork 16
126 lines (120 loc) · 3.72 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
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
name: CI
on:
push:
env:
VSCODE_INSIDERS_VERSION: 1.87.2
jobs:
prepare:
# This first step pulls dependencies and compiles the extension.
# The results are cached to speed up the next three steps.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-modules
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-modules-
- uses: actions/cache@v3
id: cache-vscode-test
with:
path: .vscode-test/vscode-*
key: ${{ runner.os }}-vscode-test
- uses: actions/cache@v3
id: cache-out
with:
path: out
key: ${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- run: yarn install --immutable
- run: yarn pretest
- run: yarn test:precache
- run: yarn compile
unit:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-modules
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-modules-
- uses: actions/cache@v3
id: cache-vscode-test
with:
path: .vscode-test/vscode-*
key: ${{ runner.os }}-vscode-test
- uses: actions/cache@v3
id: cache-out
with:
path: out
key: ${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:unit
name: Run unit tests
integration:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-modules
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-modules-
- uses: actions/cache@v3
id: cache-vscode-test
with:
path: .vscode-test/vscode-*
key: ${{ runner.os }}-vscode-test
- uses: actions/cache@v3
id: cache-out
with:
path: out
key: ${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- run: |
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
dbus-daemon --session --address=$DBUS_SESSION_BUS_ADDRESS --nofork --nopidfile --syslog-only &
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:integration
name: Run integration tests
release:
runs-on: ubuntu-latest
needs: [unit, integration]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/cache@v3
id: cache-modules
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-modules-
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- run: yarn semantic-release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_GITHUB_TOKEN }}
VSCE_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_VSCE_TOKEN }}
GIT_AUTHOR_NAME: appland-release
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: appland-release
GIT_COMMITTER_EMAIL: [email protected]