From 48167855c90cb44df5cb54719f2fcf3f1253c91c Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 1 Nov 2023 17:35:35 -0400 Subject: [PATCH] Onboard jenkins prod docker images to github actions Signed-off-by: Peter Zhu --- .github/workflows/CI.yml | 45 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 347723c4..3ace5b86 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,11 +10,50 @@ on: - "feature/**" jobs: - Build: + Get-CI-Image-Tag: + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main + with: + product: opensearch + + Build-linux: + needs: Get-CI-Image-Tag + strategy: + matrix: + java: [11, 17] + + name: Build and Test geospatial Plugin + runs-on: ubuntu-latest + 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 + + steps: + - name: Checkout geospatial + uses: actions/checkout@v1 + + - name: Setup Java ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + + - name: Run build + run: | + chown -R 1000:1000 `pwd` + su `id -un 1000` -c "./gradlew build" + + - name: Upload Coverage Report + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + Build-windows-macos: strategy: matrix: java: [11, 17] - os: [ubuntu-latest, windows-latest, macos-latest] + os: [windows-latest, macos-latest] name: Build and Test geospatial Plugin runs-on: ${{ matrix.os }} @@ -35,4 +74,4 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v1 with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }}