Skip to content

Commit 5f983c8

Browse files
authored
Add Windows CI to the GitHub workflow (opensearch-project#3290)
Signed-off-by: Manasvini B Suryanarayana <[email protected]> Signed-off-by: Manasvini B Suryanarayana <[email protected]>
1 parent 9434113 commit 5f983c8

File tree

2 files changed

+115
-7
lines changed

2 files changed

+115
-7
lines changed

.github/workflows/pr_check_workflow.yml

+114-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
2323

2424
jobs:
25-
build-lint-test:
25+
build-lint-test-linux:
2626
runs-on: ubuntu-latest
2727
name: Build and Verify
2828
steps:
@@ -59,11 +59,11 @@ jobs:
5959

6060
- name: Checkout code
6161
if: steps.job_successful.outputs.job_successful != 'true'
62-
uses: actions/checkout@v2
62+
uses: actions/checkout@v3
6363

6464
- name: Setup Node
6565
if: steps.job_successful.outputs.job_successful != 'true'
66-
uses: actions/setup-node@v2
66+
uses: actions/setup-node@v3
6767
with:
6868
node-version-file: ".nvmrc"
6969
registry-url: 'https://registry.npmjs.org'
@@ -114,8 +114,63 @@ jobs:
114114
run: echo "::set-output name=unit_tests_results::success" > unit_tests_results
115115
- if: steps.integration-tests.outcome == 'success' || steps.integration-tests.outcome == 'skipped'
116116
run: echo "::set-output name=integration_tests_results::success" > integration_tests_results
117-
functional-tests:
118-
needs: [ build-lint-test ]
117+
118+
build-lint-test-windows:
119+
runs-on: windows-latest
120+
name: Build and Verify on Windows
121+
steps:
122+
- name: Configure git's autocrlf
123+
run: |
124+
git config --global core.autocrlf false
125+
126+
- name: Checkout code
127+
uses: actions/checkout@v3
128+
129+
- name: Setup JDK
130+
uses: actions/setup-java@v3
131+
with:
132+
java-version: '11'
133+
distribution: 'adopt'
134+
135+
- name: Setup Node
136+
uses: actions/setup-node@v3
137+
with:
138+
node-version-file: '.nvmrc'
139+
registry-url: 'https://registry.npmjs.org'
140+
141+
- name: Setup Yarn
142+
run: |
143+
npm uninstall -g yarn
144+
145+
146+
- name: Run bootstrap
147+
run: yarn osd bootstrap
148+
149+
- name: Run linter
150+
id: linter
151+
run: yarn lint
152+
153+
- name: Run unit tests with coverage
154+
id: unit-tests
155+
run: yarn test:jest:ci:coverage
156+
157+
- name: Run mocha tests with coverage
158+
id: mocha-tests
159+
run: yarn test:mocha:coverage
160+
161+
- name: Upload Code Coverage
162+
id: upload-code-coverage
163+
uses: codecov/codecov-action@v3
164+
with:
165+
directory: ./target/opensearch-dashboards-coverage
166+
flags: Windows
167+
168+
- name: Run integration tests
169+
id: integration-tests
170+
run: yarn test:jest_integration:ci
171+
172+
functional-tests-linux:
173+
needs: [ build-lint-test-linux ]
119174
runs-on: ubuntu-latest
120175
name: Run functional tests
121176
strategy:
@@ -142,11 +197,11 @@ jobs:
142197

143198
- name: Checkout code
144199
if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success'
145-
uses: actions/checkout@v2
200+
uses: actions/checkout@v3
146201

147202
- name: Setup Node
148203
if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success'
149-
uses: actions/setup-node@v2
204+
uses: actions/setup-node@v3
150205
with:
151206
node-version-file: ".nvmrc"
152207
registry-url: 'https://registry.npmjs.org'
@@ -197,3 +252,55 @@ jobs:
197252

198253
- if: steps.ftr-tests.outcome == 'success' || steps.ftr-tests.outcome == 'skipped'
199254
run: echo "::set-output name=ftr_tests_results::success" > ftr_tests_results
255+
256+
functional-tests-windows:
257+
runs-on: windows-latest
258+
name: Run functional tests on Windows
259+
strategy:
260+
matrix:
261+
group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ]
262+
steps:
263+
- run: echo Running functional tests for ciGroup${{ matrix.group }}
264+
265+
- name: Configure git's autocrlf
266+
run: |
267+
git config --global core.autocrlf false
268+
269+
- name: Checkout code
270+
uses: actions/checkout@v3
271+
272+
- name: Setup JDK
273+
uses: actions/setup-java@v3
274+
with:
275+
java-version: '11'
276+
distribution: 'adopt'
277+
278+
- name: Setup Node
279+
uses: actions/setup-node@v3
280+
with:
281+
node-version-file: '.nvmrc'
282+
registry-url: 'https://registry.npmjs.org'
283+
284+
- name: Setup Yarn
285+
run: |
286+
npm uninstall -g yarn
287+
288+
289+
# image has the latest chrome v99
290+
- name: Setup chromedriver
291+
run: node scripts/upgrade_chromedriver.js
292+
293+
- name: Run bootstrap
294+
run: yarn osd bootstrap
295+
296+
- name: Build plugins
297+
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10
298+
299+
- name: Run CI test group ${{ matrix.group }}
300+
id: ftr-tests
301+
run: node scripts/functional_tests.js --config test/functional/config.js --include ciGroup${{ matrix.group }}
302+
env:
303+
CI_GROUP: ciGroup${{ matrix.group }}
304+
CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }}
305+
JOB: ci${{ matrix.group }}
306+
CACHE_DIR: ciGroup${{ matrix.group }}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3737
- Add CHANGELOG.md and related workflows ([#2414](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2414))
3838
- Update backport custom branch name to utilize head template ([#2766](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2766))
3939
- Add automatic selection of the appropriate version of chrome driver to run functional tests ([#2990](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2990))
40+
- Add Windows CI workflows ([#2966](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2966))
4041

4142
### 📝 Documentation
4243

0 commit comments

Comments
 (0)