Skip to content

Commit

Permalink
Add Windows CI to the GitHub workflow (opensearch-project#3290)
Browse files Browse the repository at this point in the history
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>

Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
  • Loading branch information
manasvinibs authored Jan 20, 2023
1 parent 9434113 commit 5f983c8
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 7 deletions.
121 changes: 114 additions & 7 deletions .github/workflows/pr_check_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true

jobs:
build-lint-test:
build-lint-test-linux:
runs-on: ubuntu-latest
name: Build and Verify
steps:
Expand Down Expand Up @@ -59,11 +59,11 @@ jobs:

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

- name: Setup Node
if: steps.job_successful.outputs.job_successful != 'true'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -114,8 +114,63 @@ jobs:
run: echo "::set-output name=unit_tests_results::success" > unit_tests_results
- if: steps.integration-tests.outcome == 'success' || steps.integration-tests.outcome == 'skipped'
run: echo "::set-output name=integration_tests_results::success" > integration_tests_results
functional-tests:
needs: [ build-lint-test ]

build-lint-test-windows:
runs-on: windows-latest
name: Build and Verify on Windows
steps:
- name: Configure git's autocrlf
run: |
git config --global core.autocrlf false
- name: Checkout code
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g yarn@1.22.10
- name: Run bootstrap
run: yarn osd bootstrap

- name: Run linter
id: linter
run: yarn lint

- name: Run unit tests with coverage
id: unit-tests
run: yarn test:jest:ci:coverage

- name: Run mocha tests with coverage
id: mocha-tests
run: yarn test:mocha:coverage

- name: Upload Code Coverage
id: upload-code-coverage
uses: codecov/codecov-action@v3
with:
directory: ./target/opensearch-dashboards-coverage
flags: Windows

- name: Run integration tests
id: integration-tests
run: yarn test:jest_integration:ci

functional-tests-linux:
needs: [ build-lint-test-linux ]
runs-on: ubuntu-latest
name: Run functional tests
strategy:
Expand All @@ -142,11 +197,11 @@ jobs:

- name: Checkout code
if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success'
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node
if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -197,3 +252,55 @@ jobs:

- if: steps.ftr-tests.outcome == 'success' || steps.ftr-tests.outcome == 'skipped'
run: echo "::set-output name=ftr_tests_results::success" > ftr_tests_results

functional-tests-windows:
runs-on: windows-latest
name: Run functional tests on Windows
strategy:
matrix:
group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ]
steps:
- run: echo Running functional tests for ciGroup${{ matrix.group }}

- name: Configure git's autocrlf
run: |
git config --global core.autocrlf false
- name: Checkout code
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g yarn@1.22.10
# image has the latest chrome v99
- name: Setup chromedriver
run: node scripts/upgrade_chromedriver.js

- name: Run bootstrap
run: yarn osd bootstrap

- name: Build plugins
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10

- name: Run CI test group ${{ matrix.group }}
id: ftr-tests
run: node scripts/functional_tests.js --config test/functional/config.js --include ciGroup${{ matrix.group }}
env:
CI_GROUP: ciGroup${{ matrix.group }}
CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }}
JOB: ci${{ matrix.group }}
CACHE_DIR: ciGroup${{ matrix.group }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add CHANGELOG.md and related workflows ([#2414](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2414))
- Update backport custom branch name to utilize head template ([#2766](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2766))
- Add automatic selection of the appropriate version of chrome driver to run functional tests ([#2990](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2990))
- Add Windows CI workflows ([#2966](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2966))

### 📝 Documentation

Expand Down

0 comments on commit 5f983c8

Please sign in to comment.