From b6ec17037e82f8c5fd25ed97ccda0e1b181e3ae3 Mon Sep 17 00:00:00 2001 From: Malena Casas Date: Tue, 12 Nov 2024 23:21:43 -0300 Subject: [PATCH] Change path to cache --- .github/workflows/build.yml | 45 +++++++++++++------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42e1fc027396a..e80b885d703a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -272,53 +272,38 @@ jobs: -d ${{ matrix.distribution }} \ -n ${{ steps.min_package.outputs.name }} - # Cache OpenSearch plugins + - name: Run `assemble.sh` + run: | + bash build-scripts/assemble.sh \ + -a ${{ matrix.architecture }} \ + -d ${{ matrix.distribution }} \ + -r ${{ inputs.revision }} + - name: Get Opensearch Version run: | VERSION=$(bash build-scripts/upstream-version.sh) echo "versionOpenSearch_inBuild=$VERSION" >> $GITHUB_OUTPUT echo "VERSION=$VERSION" >> $GITHUB_ENV + # Cache OpenSearch plugins - name: Cache OpenSearch plugins id: cache-opensearch-plugins uses: actions/cache@v4 with: path: | - //$HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0/ + ~/.m2/org/opensearch/plugin + //$HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0 $HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0 - key: ${{ runner.os }}-opensearch-performance-analyzer-${{ hashFiles('performance-analyzer**.xml') }} + $HOME/runner/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0 + key: ${{ runner.os }}-opensearch-${{ hashFiles('**/pom.xml') }} restore-keys: | - ${{ runner.os }}-opensearch-performance-analyzer + ${{ runner.os }}-opensearch- ${{ runner.os }}-opensearch - - if: ${{steps.cache-opensearch-plugins.cache-hit != 'true'}} - name: Cache OpenSearch plugins fail - run: echo "Failed to cache OpenSearch plugins. DIRECTORYY $HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0/ " - - - name: Run `assemble.sh` - run: | - bash build-scripts/assemble.sh \ - -a ${{ matrix.architecture }} \ - -d ${{ matrix.distribution }} \ - -r ${{ inputs.revision }} - - - name: Cache OpenSearch plugins POST - id: cache-opensearch-plugins-post - uses: actions/cache@v4 - with: - path: | - //$HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0/ - $HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0/ - $HOME/runner/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0/ - key: ${{ runner.os }}-opensearch-performance-analyzer-${{ hashFiles('performance-analyzer**.xml') }} - restore-keys: | - ${{ runner.os }}-opensearch-performance-analyzer - ${{ runner.os }}-opensearch - - - if: ${{steps.cache-opensearch-plugins-post.cache-hit != 'true'}} + - if: ${{steps.cache-opensearch-plugins.outputs.cache-hit != 'true'}} name: Cache OpenSearch plugins fail run: echo "Failed to cache OpenSearch plugins post assemble script. DIRECTORYY $HOME/.m2/org/opensearch/plugin/performance-analyzer/${{ env.VERSION }}.0/ " - + - name: Test RPM package if: ${{ matrix.distribution == 'rpm' }} uses: addnab/docker-run-action@v3