From abaade4a8ba5a0aac5c323f83b455f945fb65e58 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 1 Nov 2023 14:41:21 -0400 Subject: [PATCH 1/5] Onboard jenkins prod docker images to github actions Signed-off-by: Peter Zhu --- .github/workflows/check.yml | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f8d2f1c..6799d08 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,12 +2,45 @@ name: Gradle Check on: [pull_request] jobs: - precommit: + Get-CI-Image-Tag: + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main + with: + product: opensearch + + precommit-linux: + needs: Get-CI-Image-Tag + if: github.repository == 'opensearch-project/custom-codecs' + 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: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: temurin + cache: gradle + - name: Run Gradle (check) + run: | + chown -R 1000:1000 `pwd` + su `id -un 1000` -c "./gradlew check" + - name: Run Gradle (assemble) + run: | + chown -R 1000:1000 `pwd` + su `id -un 1000` -c "./gradlew assemble" + + precommit-windows-macos: if: github.repository == 'opensearch-project/custom-codecs' runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [windows-latest, macos-latest] steps: - uses: actions/checkout@v3 - name: Set up JDK 11 From 84ae542d6ac391f373203a90a733719e0d262228 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 1 Nov 2023 15:26:19 -0400 Subject: [PATCH 2/5] Add more Signed-off-by: Peter Zhu --- .github/workflows/check.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6799d08..726e8b8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,12 +28,14 @@ jobs: cache: gradle - name: Run Gradle (check) run: | - chown -R 1000:1000 `pwd` - su `id -un 1000` -c "./gradlew check" + # https://github.com/opensearch-project/opensearch-build/issues/4191 + chown -R opensearch:opensearch `pwd` + su opensearch -c "./gradlew check" - name: Run Gradle (assemble) run: | - chown -R 1000:1000 `pwd` - su `id -un 1000` -c "./gradlew assemble" + # https://github.com/opensearch-project/opensearch-build/issues/4191 + chown -R opensearch:opensearch `pwd` + su opensearch -c "./gradlew assemble" precommit-windows-macos: if: github.repository == 'opensearch-project/custom-codecs' From 4e705fcbfd16fcb5a2cfbfef5d418d61f4c12223 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 1 Nov 2023 15:53:30 -0400 Subject: [PATCH 3/5] Add more Signed-off-by: Peter Zhu --- .github/workflows/check.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 726e8b8..4469164 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,6 +9,9 @@ jobs: precommit-linux: needs: Get-CI-Image-Tag + strategy: + matrix: + java: [ 11, 17, 21 ] if: github.repository == 'opensearch-project/custom-codecs' runs-on: ubuntu-latest container: @@ -20,22 +23,16 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - cache: gradle - name: Run Gradle (check) run: | # https://github.com/opensearch-project/opensearch-build/issues/4191 chown -R opensearch:opensearch `pwd` - su opensearch -c "./gradlew check" + su opensearch -c "./gradlew check -Druntime.java=${{ matrix.java }}" - name: Run Gradle (assemble) run: | # https://github.com/opensearch-project/opensearch-build/issues/4191 chown -R opensearch:opensearch `pwd` - su opensearch -c "./gradlew assemble" + su opensearch -c "./gradlew assemble -Druntime.java=${{ matrix.java }}" precommit-windows-macos: if: github.repository == 'opensearch-project/custom-codecs' From 027bc88fe60ab205fdf4ad346e8fa103bc9d0227 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 1 Nov 2023 15:57:21 -0400 Subject: [PATCH 4/5] Add more Signed-off-by: Peter Zhu --- .github/workflows/check.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4469164..2bd13eb 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -27,25 +27,28 @@ jobs: run: | # https://github.com/opensearch-project/opensearch-build/issues/4191 chown -R opensearch:opensearch `pwd` - su opensearch -c "./gradlew check -Druntime.java=${{ matrix.java }}" + su opensearch -c "source /etc/profile.d/java_home.sh && ./gradlew check -Druntime.java=${{ matrix.java }}" - name: Run Gradle (assemble) run: | # https://github.com/opensearch-project/opensearch-build/issues/4191 chown -R opensearch:opensearch `pwd` - su opensearch -c "./gradlew assemble -Druntime.java=${{ matrix.java }}" + su opensearch -c "source /etc/profile.d/java_home.sh && ./gradlew assemble -Druntime.java=${{ matrix.java }}" precommit-windows-macos: if: github.repository == 'opensearch-project/custom-codecs' + strategy: + matrix: + java: [ 11, 17, 21 ] runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, macos-latest] steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 with: - java-version: 11 + java-version: ${{ matrix.java }} distribution: temurin cache: gradle - name: Run Gradle (check) From 1686c1d2e0985c225987009c8a179149eea8527a Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 1 Nov 2023 16:03:41 -0400 Subject: [PATCH 5/5] Add more Signed-off-by: Peter Zhu --- .github/workflows/check.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2bd13eb..6572cfd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -39,10 +39,8 @@ jobs: strategy: matrix: java: [ 11, 17, 21 ] - runs-on: ${{ matrix.os }} - strategy: - matrix: os: [windows-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Set up JDK ${{ matrix.java }}