diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index e6813935f..827e472e6 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -7,12 +7,19 @@ on: branches: - "*" env: - OPENSEARCH_DASHBOARDS_VERSION: '2.2' + OPENSEARCH_DASHBOARDS_VERSION: '2.4' jobs: tests: name: Run unit tests - runs-on: ubuntu-latest + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} steps: + # 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: @@ -42,9 +49,16 @@ jobs: run: | cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin yarn osd bootstrap - - name: Run tests + - name: Run window tests + if: ${{ matrix.os == 'windows-latest' }} + run: | + cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin + yarn run test:jest:windows --coverage + - name: Run non-window tests + if: ${{ matrix.os != 'windows-latest' }} run: | cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin yarn run test:jest --coverage - name: Uploads coverage + if: ${{ matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v1 diff --git a/package.json b/package.json index b83473977..dfd59b87f 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "osd": "node ../../scripts/osd", "opensearch": "node ../../scripts/opensearch", "lint": "../../node_modules/.bin/eslint '**/*.js' -c .eslintrc --ignore-path .gitignore", + "test:jest:windows": "SET TZ=UTC ../../node_modules/.bin/jest --config ./test/jest.config.js", "test:jest": "TZ=UTC ../../node_modules/.bin/jest --config ./test/jest.config.js", "build": "yarn plugin-helpers build", "plugin-helpers": "node ../../scripts/plugin_helpers",