From bc8d5bc5b1ca0bdbba367d772c93e5143d626eb0 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 31 Oct 2023 18:02:23 -0400 Subject: [PATCH] Add more Signed-off-by: Peter Zhu --- .github/workflows/test-and-build-workflow.yml | 113 +++++++++--------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index eb486d243..af6f1e119 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -22,8 +22,7 @@ jobs: fail-fast: false # This starts three jobs, setting these environment variables uniquely for the different jobs matrix: - java: [11] - #java: [11, 17] + java: [11, 17] feature: [ism, non-ism] include: - feature: ism @@ -75,58 +74,58 @@ jobs: name: index-management-plugin-ubuntu-latest path: index-management-artifacts -# test-and-build-windows-macos: -# env: -# BUILD_ARGS: ${{ matrix.os_build_args }} -# WORKING_DIR: ${{ matrix.working_directory }}. -# TEST_FILTER: ${{ matrix.test_filter }} -# strategy: -# # This setting says that all jobs should finish, even if one fails -# fail-fast: false -# # This starts three jobs, setting these environment variables uniquely for the different jobs -# matrix: -# java: [11, 17] -# os: [windows-latest, macos-latest] -# feature: [ism, non-ism] -# include: -# - os: windows-latest -# os_build_args: -x integTest -x jacocoTestReport -# working_directory: X:\ -# os_java_options: -Xmx4096M -# - os: macos-latest -# os_build_args: -x integTest -x jacocoTestReport -# - feature: ism -# test_filter: -PincludeTests="org.opensearch.indexmanagement.indexstatemanagement*" -# - feature: non-ism -# test_filter: -PexcludeTests="org.opensearch.indexmanagement.indexstatemanagement*" -# runs-on: ${{ matrix.os }} -# steps: -# # This step uses the setup-java Github action: https://github.com/actions/setup-java -# - name: Set Up JDK ${{ matrix.java }} -# uses: actions/setup-java@v2 -# with: -# distribution: temurin # Temurin is a distribution of adoptium -# java-version: ${{ matrix.java }} -# # build index management -# - name: Checkout Branch -# uses: actions/checkout@v2 -# # This is a hack, but this step creates a link to the X: mounted drive, which makes the path -# # short enough to work on Windows -# - name: Shorten Path -# if: ${{ matrix.os == 'windows-latest' }} -# run: subst 'X:' . -# - name: Build with Gradle -# working-directory: ${{ env.WORKING_DIR }} -# run: ./gradlew build ${{ env.BUILD_ARGS }} ${{ env.TEST_FILTER }} -# env: -# _JAVA_OPTIONS: ${{ matrix.os_java_options }} -# - name: Create Artifact Path -# run: | -# mkdir -p index-management-artifacts -# cp ./build/distributions/*.zip index-management-artifacts -# # This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact -# - name: Upload Artifacts -# uses: actions/upload-artifact@v1 -# with: -# name: index-management-plugin-${{ matrix.os }} -# path: index-management-artifacts + test-and-build-windows-macos: + env: + BUILD_ARGS: ${{ matrix.os_build_args }} + WORKING_DIR: ${{ matrix.working_directory }}. + TEST_FILTER: ${{ matrix.test_filter }} + strategy: + # This setting says that all jobs should finish, even if one fails + fail-fast: false + # This starts three jobs, setting these environment variables uniquely for the different jobs + matrix: + java: [11, 17] + os: [windows-latest, macos-latest] + feature: [ism, non-ism] + include: + - os: windows-latest + os_build_args: -x integTest -x jacocoTestReport + working_directory: X:\ + os_java_options: -Xmx4096M + - os: macos-latest + os_build_args: -x integTest -x jacocoTestReport + - feature: ism + test_filter: -PincludeTests="org.opensearch.indexmanagement.indexstatemanagement*" + - feature: non-ism + test_filter: -PexcludeTests="org.opensearch.indexmanagement.indexstatemanagement*" + runs-on: ${{ matrix.os }} + steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK ${{ matrix.java }} + uses: actions/setup-java@v2 + with: + distribution: temurin # Temurin is a distribution of adoptium + java-version: ${{ matrix.java }} + # build index management + - name: Checkout Branch + uses: actions/checkout@v2 + # This is a hack, but this step creates a link to the X: mounted drive, which makes the path + # short enough to work on Windows + - name: Shorten Path + if: ${{ matrix.os == 'windows-latest' }} + run: subst 'X:' . + - name: Build with Gradle + working-directory: ${{ env.WORKING_DIR }} + run: ./gradlew build ${{ env.BUILD_ARGS }} ${{ env.TEST_FILTER }} + env: + _JAVA_OPTIONS: ${{ matrix.os_java_options }} + - name: Create Artifact Path + run: | + mkdir -p index-management-artifacts + cp ./build/distributions/*.zip index-management-artifacts + # This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact + - name: Upload Artifacts + uses: actions/upload-artifact@v1 + with: + name: index-management-plugin-${{ matrix.os }} + path: index-management-artifacts