Skip to content

Commit

Permalink
Add macos and window platform in CI workflow (opensearch-project#63)
Browse files Browse the repository at this point in the history
* Add macos and window platform in CI workflow

Signed-off-by: Heemin Kim <[email protected]>

* Restrict github action path to custom import map

Signed-off-by: Heemin Kim <[email protected]>

Signed-off-by: Heemin Kim <[email protected]>
  • Loading branch information
heemin32 authored Oct 17, 2022
1 parent c037003 commit cb38a15
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/unit-tests-workflow-for-customImportMap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,38 @@ name: Unit tests workflow
on:
push:
branches:
- main
- "*"
- "feature/**"
paths:
- src/plugins/custom_import_map/**
- .github/workflows/unit-tests-workflow-for-customImportMap.yml
pull_request:
branches:
- main
- "*"
- "feature/**"
paths:
- src/plugins/custom_import_map/**
- .github/workflows/unit-tests-workflow-for-customImportMap.yml

env:
OPENSEARCH_DASHBOARDS_VERSION: '2.0'
jobs:
tests:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]

name: Run unit tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Plugin
uses: actions/checkout@v2

# Enable longer filenames for windows
- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -50,10 +67,12 @@ jobs:
cd OpenSearch-Dashboards/plugins/src/plugins/custom_import_map
yarn osd bootstrap
- name: Run tests
- name: Run tests with coverage
run: |
cd OpenSearch-Dashboards/plugins/src/plugins/custom_import_map
yarn run test:jest --coverage
- name: Uploads coverage
uses: codecov/codecov-action@v1


2 changes: 1 addition & 1 deletion src/plugins/custom_import_map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "yarn run lint:es && yarn run lint:style",
"lint:es": "node ../../../../scripts/eslint",
"lint:style": "node ../../../../scripts/stylelint",
"test:jest": "TZ=UTC ../../../../node_modules/.bin/jest --config ./test/jest.config.js"
"test:jest": "../../../../node_modules/.bin/jest --config ./test/jest.config.js"
},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/custom_import_map/test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

process.env.TZ = 'UTC';
module.exports = {
rootDir: '../',
setupFiles: [
Expand Down

0 comments on commit cb38a15

Please sign in to comment.