diff --git a/.github/workflows/dashboards-observability-test-and-build-workflow.yml b/.github/workflows/dashboards-observability-test-and-build-workflow.yml index 610c15b460..59da439abd 100644 --- a/.github/workflows/dashboards-observability-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-observability-test-and-build-workflow.yml @@ -39,6 +39,22 @@ jobs: with: path: OpenSearch-Dashboards/plugins/dashboards-observability + - name: Get yarn cache dir + id: setup-yarn + 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: @@ -118,6 +134,19 @@ jobs: - run: node -v - run: yarn -v + - name: Get yarn cache dir + id: setup-yarn + 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: