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