-
Notifications
You must be signed in to change notification settings - Fork 10
196 lines (164 loc) · 5.49 KB
/
Copy pathtest-vscode-ci.yml
File metadata and controls
196 lines (164 loc) · 5.49 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Test VS Code CI Infrastructure
# Test workflow for the vscode-extension-ci package and composite actions
# Can be run manually from the Actions tab on the feat/add-vscode-extension-ci branch
on:
workflow_dispatch:
inputs:
test-repo:
description: 'Repository to test against'
required: false
default: 'apex-language-support'
type: choice
options:
- apex-language-support
- salesforcedx-vscode
jobs:
test-npm-package:
name: Test NPM Package Build
runs-on: ubuntu-latest
steps:
- name: Checkout github-workflows
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Install dependencies
run: |
cd packages/vscode-extension-ci
npm install
- name: Build package
run: |
cd packages/vscode-extension-ci
npm run build
- name: Verify CLI exists
run: |
cd packages/vscode-extension-ci
node dist/cli.js --help
- name: Test CLI commands exist
run: |
cd packages/vscode-extension-ci
node dist/cli.js --help | grep -E "ext-package-selector|ext-change-detector|ext-build-type"
test-with-apex-language-support:
name: Test with apex-language-support
runs-on: ubuntu-latest
if: inputs.test-repo == 'apex-language-support'
steps:
- name: Checkout github-workflows
uses: actions/checkout@v6
path: .ci-toolkit
- name: Checkout apex-language-support
uses: actions/checkout@v6
with:
repository: forcedotcom/apex-language-support
path: test-repo
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Build vscode-extension-ci
run: |
cd .ci-toolkit/packages/vscode-extension-ci
npm install
npm run build
- name: Install apex-language-support dependencies
run: |
cd test-repo
npm ci
- name: Test ext-package-selector
run: |
cd test-repo
node ../.ci-toolkit/packages/vscode-extension-ci/dist/cli.js ext-package-selector
- name: Test ext-build-type
run: |
cd test-repo
node ../.ci-toolkit/packages/vscode-extension-ci/dist/cli.js ext-build-type
test-with-salesforcedx-vscode:
name: Test with salesforcedx-vscode
runs-on: ubuntu-latest
if: inputs.test-repo == 'salesforcedx-vscode'
steps:
- name: Checkout github-workflows
uses: actions/checkout@v6
path: .ci-toolkit
- name: Checkout salesforcedx-vscode
uses: actions/checkout@v6
with:
repository: forcedotcom/salesforcedx-vscode
path: test-repo
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Build vscode-extension-ci
run: |
cd .ci-toolkit/packages/vscode-extension-ci
npm install
npm run build
- name: Install salesforcedx-vscode dependencies
run: |
cd test-repo
npm ci
- name: Test ext-package-selector
run: |
cd test-repo
node ../.ci-toolkit/packages/vscode-extension-ci/dist/cli.js ext-package-selector
- name: Test ext-build-type
run: |
cd test-repo
node ../.ci-toolkit/packages/vscode-extension-ci/dist/cli.js ext-build-type
test-composite-actions:
name: Test Composite Actions
runs-on: ubuntu-latest
steps:
- name: Checkout github-workflows
uses: actions/checkout@v6
path: .ci-toolkit
- name: Checkout apex-language-support
uses: actions/checkout@v6
with:
repository: forcedotcom/apex-language-support
path: test-repo
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Test npm-install-with-retries (in test-repo)
working-directory: test-repo
run: |
# Simulate what the action does
npm config set fetch-timeout 600000
npm ci
- name: Test detect-packages
id: detect
uses: ./.ci-toolkit/.github/actions/vscode/detect-packages
- name: Show detected packages
run: |
echo "Detected packages: ${{ steps.detect.outputs.packages }}"
echo "Detected extensions: ${{ steps.detect.outputs.extensions }}"
- name: Test calculate-artifact-name
id: artifact-name
uses: ./.ci-toolkit/.github/actions/vscode/calculate-artifact-name
with:
extension-name: apex-lsp-vscode-extension
mode: nightly
- name: Show artifact name
run: echo "Artifact name: ${{ steps.artifact-name.outputs.artifact-name }}"
test-complete:
name: All Tests Complete
runs-on: ubuntu-latest
needs: [test-npm-package, test-composite-actions]
if: always()
steps:
- name: Check results
env:
NPM_RESULT: ${{ needs.test-npm-package.result }}
ACTIONS_RESULT: ${{ needs.test-composite-actions.result }}
run: |
echo "NPM Package Build: $NPM_RESULT"
echo "Composite Actions: $ACTIONS_RESULT"
if [[ "$NPM_RESULT" != "success" ]] || [[ "$ACTIONS_RESULT" != "success" ]]; then
echo "❌ Some tests failed"
exit 1
fi
echo "✅ All tests passed"