-
Notifications
You must be signed in to change notification settings - Fork 70
207 lines (204 loc) · 7.33 KB
/
test.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
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
197
198
199
200
201
202
203
204
205
206
207
name: tests
on:
push:
branches-ignore: [main]
workflow_dispatch:
jobs:
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
integration:
needs: linux-unit-tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [lts/*, latest]
exclude:
- os: windows-latest
node_version: lts/*
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- if: runner.os == 'Windows'
run: yarn mocha --forbid-only "test/**/*.integration.ts" --exclude "test/integration/sf.integration.ts" --parallel --timeout 1200000
- if: runner.os == 'Linux'
run: yarn test:integration --retries 3
windows-sf-integration:
# For whatever reason the windows-latest runner doesn't like it when you shell yarn commands in the sf repo
# which is an integral part of the setup for the tests. Instead, we replicate the setup here.
needs: linux-unit-tests
strategy:
fail-fast: false
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn link
- run: New-Item -Path D:\a -Name "integration" -ItemType "directory"
- run: New-Item -Path D:\a\integration -Name "sf.integration.ts" -ItemType "directory"
- run: |
git clone https://github.com/salesforcecli/cli.git
cd cli
$Json = Get-Content package.json | ConvertFrom-Json
$Json.dependencies | Add-Member -Force -MemberType NoteProperty -Name "@oclif/core" -Value "file:D:\a\core\core"
$Json.resolutions | Add-Member -MemberType NoteProperty -Name "@oclif/core" -Value "D:\a\core\core"
$Json | ConvertTo-Json -Depth 9 | Out-File package.json
yarn install --network-timeout 600000
yarn link @oclif/core
yarn build
working-directory: D:\a\integration\sf.integration.ts
- run: yarn mocha --forbid-only "test/integration/sf.integration.ts" --parallel --timeout 1200000
env:
OCLIF_CORE_INTEGRATION_SKIP_SETUP: true
OCLIF_CORE_INTEGRATION_TEST_DIR: D:\a\integration
DEBUG: integration:*
interoperability:
needs: linux-unit-tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [lts/*, latest]
test: [esm, cjs, precore, coreV1, coreV2, coreV3, esbuild]
dev_runtime: [default, bun, tsx]
exclude:
- os: windows-latest
node_version: lts/*
- os: windows-latest
dev_runtime: tsx
- os: windows-latest
dev_runtime: bun
- test: precore
dev_runtime: tsx
- test: precore
dev_runtime: bun
- test: coreV1
dev_runtime: tsx
- test: coreV1
dev_runtime: bun
- test: coreV2
dev_runtime: tsx
- test: coreV2
dev_runtime: bun
- test: coreV3
dev_runtime: tsx
- test: coreV3
dev_runtime: bun
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 75
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- if: matrix.dev_runtime == 'bun'
uses: oven-sh/setup-bun@v1
- if: matrix.dev_runtime == 'tsx'
run: 'npm install -g tsx'
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn test:interoperability --test=${{ matrix.test }} --dev-run-time=${{ matrix.dev_runtime }}
nuts:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
externalProjectGitUrl:
- https://github.com/salesforcecli/plugin-auth
- https://github.com/salesforcecli/plugin-data
- https://github.com/salesforcecli/plugin-org
- https://github.com/salesforcecli/plugin-schema
- https://github.com/salesforcecli/plugin-user
- https://github.com/salesforcecli/plugin-settings
with:
packageName: '@oclif/core'
externalProjectGitUrl: ${{ matrix.externalProjectGitUrl }}
command: 'yarn test:nuts'
os: ${{ matrix.os }}
useCache: false
preSwapCommands: 'npx yarn-deduplicate; yarn install'
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/sf-plugins-core/node_modules/@oclif/core'
ignoreScripts: true
secrets:
TESTKIT_AUTH_URL: ${{ secrets.TESTKIT_AUTH_URL }}
TESTKIT_HUB_USERNAME: ${{ secrets.TESTKIT_HUB_USERNAME }}
TESTKIT_JWT_CLIENT_ID: ${{ secrets.TESTKIT_JWT_CLIENT_ID }}
TESTKIT_JWT_KEY: ${{ secrets.TESTKIT_JWT_KEY }}
TESTKIT_HUB_INSTANCE: ${{ secrets.TESTKIT_HUB_INSTANCE }}
external-unit-tests:
needs: linux-unit-tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
repo:
- oclif/plugin-autocomplete
- oclif/plugin-commands
- oclif/plugin-help
- oclif/plugin-not-found
- oclif/plugin-plugins
- oclif/plugin-update
- oclif/plugin-which
- oclif/plugin-warn-if-update-available
- oclif/plugin-version
- oclif/plugin-test-esbuild
uses: ./.github/workflows/external-test.yml
with:
repo: ${{ matrix.repo }}
os: ${{ matrix.os }}
command: 'yarn mocha test/**/*.test.ts --timeout 1200000'
plugin-plugins-integration:
needs: linux-unit-tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
uses: ./.github/workflows/external-test.yml
with:
repo: oclif/plugin-plugins
os: ${{ matrix.os }}
command: yarn test:integration --retries 3
# plugin-plugins integration tests depend on sf being installed globally
other-setup: npm install -g @salesforce/cli@nightly
plugin-update-integration:
needs: linux-unit-tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
uses: ./.github/workflows/external-test.yml
with:
repo: oclif/plugin-update
os: ${{ matrix.os }}
command: yarn test:integration:sf --retries 3
plugin-esbuild-integration:
needs: linux-unit-tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
uses: ./.github/workflows/external-test.yml
with:
repo: oclif/plugin-test-esbuild-single
os: ${{ matrix.os }}
command: yarn test