-
Notifications
You must be signed in to change notification settings - Fork 22
151 lines (141 loc) · 4.53 KB
/
ci-cd.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- published
jobs:
build-test:
name: Build and run UI Tests
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install npm dependencies and build
run: yarn --frozen-lockfile
- name: Package as VSCode Extension
run: yarn vsce:package
- name: Download sample traces
run: yarn download:sample-traces
- name: Download trace server
run: yarn download:server
- name: Start trace server
run: yarn start:server &
- name: Download openvscode-server
run: yarn download:openvscode-server
- name: Configure openvscode-server
run: yarn configure:openvscode-server
- name: Start openvscode-server
run: yarn start:openvscode-server &
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
# Save the extension .vsix file for potential publishing
# in later step (if appropriate)
- uses: actions/upload-artifact@v4
with:
name: extension
path: vscode-trace-extension/*.vsix
code-lint:
name: Run linter
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# ESLint and Prettier must be in `package.json`
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-scripts
- name: Run lint
run: yarn lint
- name: Run format check
run: yarn format:check
publish-oxsv:
# https://open-vsx.org/
name: Publish extension to public Open VSX Registry
runs-on: ${{ matrix.os }}
needs:
- build-test
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18]
# Only execute when the trigger was a tag (new release)
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'eclipse-cdt-cloud/vscode-trace-extension'
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: extension
path: vscode-trace-extension
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-scripts
- name: Publish extension
run: |
ls -al vscode-trace-extension/*.vsix
npx ovsx publish vscode-trace-extension/*.vsix
env:
# have ovsx consume the PAT from environment - if it's not handled explicitly
# in the workflow, less risk to leak it
OVSX_PAT: ${{ secrets.OPEN_VSX_TOKEN }}
publish-vs-marketplace:
# https://marketplace.visualstudio.com/
name: Publish extension to Visual Studio Marketplace
runs-on: ${{ matrix.os }}
needs:
- build-test
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18]
# Only execute when the trigger was a tag (new release)
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'eclipse-cdt-cloud/vscode-trace-extension'
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: extension
path: vscode-trace-extension
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-scripts
- name: Publish extension
run: |
ls -al vscode-trace-extension/*.vsix
npx vsce publish -i vscode-trace-extension/*.vsix --skip-duplicate
env:
# have vsce consume the PAT from environment - if it's not handled explicitly
# in the workflow, less risk to leak it
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}