From 33d7f35f1faf05ea9672774dd983764fb2b09c92 Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Tue, 6 Dec 2022 12:49:30 -0500 Subject: [PATCH] [BACKPORT 1.3] feat: enable windows and macos builds (#1108) (#1328) * feat: enable windows and macos builds (#1108) * fix: initial code to add windows support for opensearch-observability Signed-off-by: Derek Ho * add build for windows in dashboards-observability Signed-off-by: Derek Ho * change windows command and add windows build for UI modules Signed-off-by: Derek Ho * try gradlew bat for windows Signed-off-by: Derek Ho * try to exclude tests Signed-off-by: Derek Ho * fix jacoco Signed-off-by: Derek Ho * do for mac and change name Signed-off-by: Derek Ho * try to run the tests for windows and mac Signed-off-by: Derek Ho * try to add gitattributes file Signed-off-by: Derek Ho * add formatting rule Signed-off-by: Derek Ho * try to enable both Signed-off-by: Derek Ho * try to add git config to fix Signed-off-by: Derek Ho * autocrlf false for windwos and remove comments Signed-off-by: Derek Ho * comment out bwc tests, Signed-off-by: Derek Ho * add line Signed-off-by: Derek Ho * fix up using matrix and fix test Signed-off-by: Derek Ho Signed-off-by: Derek Ho (cherry picked from commit 363ccd4946fcbb9280078e694846e9aa8a8753b0) Signed-off-by: Derek Ho * remove java 17 Signed-off-by: Derek Ho * remove -d for windows Signed-off-by: Derek Ho * Update .github/workflows/dashboards-observability-test-and-build-workflow.yml Signed-off-by: Derek Ho * fix fail fast Signed-off-by: Derek Ho * try to do fix step for mac Signed-off-by: Derek Ho * remove mac Signed-off-by: Derek Ho Signed-off-by: Derek Ho --- ...-observability-test-and-build-workflow.yml | 14 ++++++----- ...-observability-test-and-build-workflow.yml | 25 ++++++++++++------- .../public/components/explorer/no_results.tsx | 3 +-- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dashboards-observability-test-and-build-workflow.yml b/.github/workflows/dashboards-observability-test-and-build-workflow.yml index 6137b05f6..f8b9f70b4 100644 --- a/.github/workflows/dashboards-observability-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-observability-test-and-build-workflow.yml @@ -11,8 +11,11 @@ env: jobs: build: - - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout Plugin @@ -57,13 +60,13 @@ jobs: yarn test --coverage - name: Upload coverage + if: ${{ matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v1 with: flags: dashboards-observability directory: ./OpenSearch-Dashboards/plugins/dashboards-observability token: ${{ secrets.CODECOV_TOKEN }} - # TODO remove hard coded version when observability is ready - name: Build Artifact run: | cd OpenSearch-Dashboards/plugins/dashboards-observability @@ -73,6 +76,5 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v1 with: - name: dashboards-observability - path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build - + name: dashboards-observability-${{ matrix.os }} + path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build \ No newline at end of file diff --git a/.github/workflows/opensearch-observability-test-and-build-workflow.yml b/.github/workflows/opensearch-observability-test-and-build-workflow.yml index 3b3c62f67..157c3a822 100644 --- a/.github/workflows/opensearch-observability-test-and-build-workflow.yml +++ b/.github/workflows/opensearch-observability-test-and-build-workflow.yml @@ -9,14 +9,18 @@ env: jobs: build: + env: + BUILD_ARGS: ${{ matrix.os_build_args }} strategy: matrix: - java: - - 8 - - 11 - - 14 - - runs-on: ubuntu-latest + java: [8, 11] + os: [ubuntu-latest, windows-latest, macos-latest] + include: + - os: windows-latest + os_build_args: -x integTest -x jacocoTestReport + - os: macos-latest + os_build_args: -x integTest -x jacocoTestReport + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 @@ -27,6 +31,8 @@ jobs: java-version: ${{ matrix.java }} - name: Run Backwards Compatibility Tests + # Temporarily only do this for linux + if: ${{ matrix.os == 'ubuntu-latest' }} run: | cd opensearch-observability echo "Running backwards compatibility tests ..." @@ -35,9 +41,10 @@ jobs: - name: Build with Gradle run: | cd opensearch-observability - ./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} + ./gradlew build ${{ env.BUILD_ARGS }} - name: Upload coverage + if: ${{ matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v1 with: flags: opensearch-observability @@ -52,5 +59,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v1 with: - name: opensearch-observability - path: opensearch-observability-builds + name: opensearch-observability-${{ matrix.os }} + path: opensearch-observability-builds \ No newline at end of file diff --git a/dashboards-observability/public/components/explorer/no_results.tsx b/dashboards-observability/public/components/explorer/no_results.tsx index 802099729..91cc8ab62 100644 --- a/dashboards-observability/public/components/explorer/no_results.tsx +++ b/dashboards-observability/public/components/explorer/no_results.tsx @@ -38,8 +38,7 @@ export const NoResults = () => {