Skip to content

Commit

Permalink
Move upload-artifact outside of the container
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Nov 7, 2024
1 parent 3ec460a commit f8bdc88
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ jobs:
runs-on: ubuntu-latest
needs: Get-CI-Image-Tag
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

# Allow using Node16 actions
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

Expand All @@ -42,7 +38,6 @@ jobs:
java-version: ${{ matrix.java }}

- name: Run build
# switching the user, as OpenSearch cluster can only be started as root/Administrator on linux-deb/linux-rpm/windows-zip.
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew build && ./gradlew publishToMavenLocal"
Expand All @@ -52,14 +47,20 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- uses: actions/upload-artifact@v3
if: always()
upload-linux-artifacts:
needs: build-job-scheduler-linux
if: always()
runs-on: ubuntu-latest
strategy:
matrix:
java: [21, 23]
steps:
- uses: actions/upload-artifact@v4
with:
name: linux-JDK${{ matrix.java }}-reports
path: |
./build/reports/
build-job-scheduler-MacOS:
strategy:
fail-fast: false
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: macos-JDK${{ matrix.java }}-reports
Expand All @@ -104,7 +105,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 21, 23 ]
java: [21, 23]

name: Build job-scheduler Plugin on Windows
needs: Get-CI-Image-Tag
Expand Down Expand Up @@ -132,9 +133,16 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- uses: actions/upload-artifact@v3
if: always()
upload-windows-artifacts:
needs: build-job-scheduler-Windows
if: always()
runs-on: windows-latest
strategy:
matrix:
java: [21, 23]
steps:
- uses: actions/upload-artifact@v4
with:
name: windows-JDK${{ matrix.java }}-reports
path: |
./build/reports/
./build/reports/

0 comments on commit f8bdc88

Please sign in to comment.