diff --git a/.github/workflows/dashboards-observability-test-and-build-workflow.yml b/.github/workflows/dashboards-observability-test-and-build-workflow.yml index 7d998c011..8c0c89fab 100644 --- a/.github/workflows/dashboards-observability-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-observability-test-and-build-workflow.yml @@ -36,6 +36,23 @@ jobs: with: path: OpenSearch-Dashboards/plugins/dashboards-observability + - name: Get yarn cache dir + id: setup-yarn + shell: bash + run: | + cd ./OpenSearch-Dashboards + source $NVM_DIR/nvm.sh + nvm use + echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Yarn Cache + uses: actions/cache@v4 + with: + path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }} + key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-yarn- + - name: Plugin Bootstrap uses: nick-fields/retry@v2 with: @@ -112,6 +129,20 @@ jobs: - run: node -v - run: yarn -v + - name: Get yarn cache dir + id: setup-yarn + shell: bash + run: | + echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Yarn Cache + uses: actions/cache@v4 + with: + path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }} + key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-yarn- + - name: Checkout Dashboards Observability uses: actions/checkout@v2 with: diff --git a/.github/workflows/ftr-e2e-dashboards-observability-test.yml b/.github/workflows/ftr-e2e-dashboards-observability-test.yml index 3c30a95ba..28b2938be 100644 --- a/.github/workflows/ftr-e2e-dashboards-observability-test.yml +++ b/.github/workflows/ftr-e2e-dashboards-observability-test.yml @@ -122,16 +122,31 @@ jobs: registry-url: "https://registry.npmjs.org" - name: Install correct yarn version for OpenSearch Dashboards + id: setup-yarn run: | npm uninstall -g yarn echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Bootstrap the plugin + - name: Yarn Cache + uses: actions/cache@v4 + with: + path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }} + key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-yarn- + + - name: Bootstrap OpenSearch Dashboards run: | - cd OpenSearch-Dashboards/plugins/dashboards-observability + cd OpenSearch-Dashboards yarn osd bootstrap --single-version=loose + - name: Compile OpenSearch Dashboards + run: | + cd OpenSearch-Dashboards + node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers=10 --verbose + - name: Run OpenSearch Dashboards server run: | cd OpenSearch-Dashboards @@ -141,12 +156,12 @@ jobs: if: ${{ runner.os == 'Linux' }} run: | cd ./OpenSearch-Dashboards - if timeout 600 grep -q "bundles compiled successfully after" <(tail -n0 -f dashboard.log); then - echo "OpenSearch Dashboards compiled successfully." + if timeout 60 grep -q "http server running" <(tail -n +1 -f dashboard.log); then + echo "OpenSearch Dashboards started successfully." else - echo "Timeout for 600 seconds reached. OpenSearch Dashboards did not finish compiling." + echo "Timeout of 60 seconds reached. OpenSearch Dashboards did not start successfully." exit 1 - fi + fi& - name: Checkout Dashboards Functioanl Test Repo uses: actions/checkout@v2 diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index d975d81ed..2311690d4 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -140,16 +140,31 @@ jobs: working-directory: OpenSearch-Dashboards - name: Install correct yarn version for OpenSearch Dashboards + id: setup-yarn run: | npm uninstall -g yarn echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - name: Bootstrap the plugin + - name: Yarn Cache + uses: actions/cache@v4 + with: + path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }} + key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-yarn- + + - name: Bootstrap OpenSearch Dashboards run: | - cd OpenSearch-Dashboards/plugins/dashboards-observability + cd OpenSearch-Dashboards yarn osd bootstrap --single-version=loose + - name: Compile OpenSearch Dashboards + run: | + cd OpenSearch-Dashboards + node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers=10 --verbose + - name: Run OpenSearch Dashboards server run: | cd OpenSearch-Dashboards @@ -159,12 +174,12 @@ jobs: if: ${{ runner.os == 'Linux' }} run: | cd ./OpenSearch-Dashboards - if timeout 600 grep -q "bundles compiled successfully after" <(tail -n0 -f dashboard.log); then - echo "OpenSearch Dashboards compiled successfully." + if timeout 60 grep -q "http server running" <(tail -n +1 -f dashboard.log); then + echo "OpenSearch Dashboards started successfully." else - echo "Timeout for 600 seconds reached. OpenSearch Dashboards did not finish compiling." + echo "Timeout of 60 seconds reached. OpenSearch Dashboards did not start successfully." exit 1 - fi + fi& - name: Install Cypress run: |