From 04762bb57a86f1a28f81c666c88027cbd7f6b654 Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Wed, 1 Dec 2021 23:31:38 +0000 Subject: [PATCH 01/14] Testing windows-latest Signed-off-by: Robert Downs --- .github/workflows/test-and-build-workflow.yml | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index de9620d82..298c72e37 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -9,7 +9,7 @@ on: - "*" jobs: - build: + linux-build: # Job name name: Build Index Management # This job runs on Linux @@ -45,3 +45,39 @@ jobs: with: name: index-management-plugin path: index-management-artifacts + windows-build: + # Job name + name: Build Index Management + # This job runs on Windows + runs-on: windows-latest + steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + # build index management + - name: Checkout Branch + uses: actions/checkout@v2 + - name: Build with Gradle + run: ./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT + - name: Upload failed logs + uses: actions/upload-artifact@v2 + if: failure() + with: + name: logs + path: build/testclusters/integTest-*/logs/* + - name: Create Artifact Path + run: | + mkdir -p index-management-artifacts + cp ./build/distributions/*.zip index-management-artifacts + - name: Uploads coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + # 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 + path: index-management-artifacts From 0a76ecc113fb69cc00d49bc1fcf4488558a3e1b5 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Wed, 1 Dec 2021 17:10:32 -0800 Subject: [PATCH 02/14] Removes ./ from gradlew command Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 298c72e37..e18e7919c 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -60,7 +60,7 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle - run: ./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT + run: gradlew build -Dopensearch.version=1.2.0-SNAPSHOT - name: Upload failed logs uses: actions/upload-artifact@v2 if: failure() From 618e353da3b4b07131d07288aebf7cac221a3d89 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Wed, 1 Dec 2021 17:12:37 -0800 Subject: [PATCH 03/14] Adds .bat for gradlew Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index e18e7919c..f99691bcf 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -60,7 +60,7 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle - run: gradlew build -Dopensearch.version=1.2.0-SNAPSHOT + run: ./gradlew.bat build -Dopensearch.version=1.2.0-SNAPSHOT - name: Upload failed logs uses: actions/upload-artifact@v2 if: failure() From dd3c1b98a5b5057c6111d1a7a3796eac21ca5d42 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Wed, 1 Dec 2021 17:27:19 -0800 Subject: [PATCH 04/14] Adds quotations for command line arg Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index f99691bcf..e5a8bd0ec 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -60,7 +60,7 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle - run: ./gradlew.bat build -Dopensearch.version=1.2.0-SNAPSHOT + run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" - name: Upload failed logs uses: actions/upload-artifact@v2 if: failure() From caf612a5e2f3a8b2c296a11b02c3c8c3a159e379 Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Thu, 2 Dec 2021 20:03:49 +0000 Subject: [PATCH 05/14] Uses subst to shorten path Signed-off-by: Robert Downs --- .github/workflows/test-and-build-workflow.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index e5a8bd0ec..59a3ca69d 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -56,11 +56,18 @@ jobs: uses: actions/setup-java@v1 with: java-version: 14 + # This step creates a link to the X: mounted drive, which makes the path short enough to work on windows + - name: Shorten Path + run: subst 'X:' . + - name: Go to Shorter Path + run: cd 'X:' # build index management - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" + env: + _JAVA_OPTIONS: -Xmx4096M - name: Upload failed logs uses: actions/upload-artifact@v2 if: failure() From 4a91ffddfa544f409a4e28695ef0e82960e5f704 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Thu, 2 Dec 2021 12:25:18 -0800 Subject: [PATCH 06/14] Uses working-directory Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 59a3ca69d..5ac3aedee 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -56,15 +56,14 @@ jobs: uses: actions/setup-java@v1 with: java-version: 14 - # This step creates a link to the X: mounted drive, which makes the path short enough to work on windows - - name: Shorten Path - run: subst 'X:' . - - name: Go to Shorter Path - run: cd 'X:' # build index management - name: Checkout Branch uses: actions/checkout@v2 + # This step creates a link to the X: mounted drive, which makes the path short enough to work on windows + - name: Shorten Path + run: subst 'X:' . - name: Build with Gradle + working-directory: 'X:' run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" env: _JAVA_OPTIONS: -Xmx4096M From a39ce8432d032a51f3e1da3103c383d8d0220376 Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Fri, 3 Dec 2021 00:13:17 +0000 Subject: [PATCH 07/14] Adds mac and windows Unit tests and build Signed-off-by: Robert Downs --- .github/workflows/test-and-build-workflow.yml | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 5ac3aedee..487c0ec32 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -34,7 +34,7 @@ jobs: - name: Create Artifact Path run: | mkdir -p index-management-artifacts - cp ./build/distributions/*.zip index-management-artifacts + cp ./build/distributions/*.zip index-management-artifacts - name: Uploads coverage uses: codecov/codecov-action@v1 with: @@ -59,20 +59,15 @@ jobs: # build index management - name: Checkout Branch uses: actions/checkout@v2 - # This step creates a link to the X: mounted drive, which makes the path short enough to work on windows + # 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 run: subst 'X:' . - name: Build with Gradle working-directory: 'X:' - run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" + run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" -x integTest -x jacocoTestReport env: _JAVA_OPTIONS: -Xmx4096M - - name: Upload failed logs - uses: actions/upload-artifact@v2 - if: failure() - with: - name: logs - path: build/testclusters/integTest-*/logs/* - name: Create Artifact Path run: | mkdir -p index-management-artifacts @@ -87,3 +82,33 @@ jobs: with: name: index-management-plugin path: index-management-artifacts + mac-build: + # Job name + name: Build Index Management + # This job runs on Windows + runs-on: windows-latest + steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + # build index management + - name: Checkout Branch + uses: actions/checkout@v2 + - name: Build with Gradle + run: ./gradlew.bat build -Dopensearch.version=1.2.0-SNAPSHOT -x integTest -x jacocoTestReport + - name: Create Artifact Path + run: | + mkdir -p index-management-artifacts + cp ./build/distributions/*.zip index-management-artifacts + - name: Uploads coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + # 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 + path: index-management-artifacts \ No newline at end of file From 52f9d3bbe9ed01e2fe53797b9925990f021b1acd Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Thu, 2 Dec 2021 16:18:51 -0800 Subject: [PATCH 08/14] Corrects mac distribution name Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 487c0ec32..4c2ea7e84 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -85,8 +85,8 @@ jobs: mac-build: # Job name name: Build Index Management - # This job runs on Windows - runs-on: windows-latest + # This job runs on Mac OS + runs-on: macos-latest steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - name: Set Up JDK 14 From 63e9d623f40c098531904dcf1463ac477dd231c2 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Thu, 2 Dec 2021 16:20:59 -0800 Subject: [PATCH 09/14] Corrects gradlew path Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 4c2ea7e84..5cb7b9d2d 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -97,7 +97,7 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle - run: ./gradlew.bat build -Dopensearch.version=1.2.0-SNAPSHOT -x integTest -x jacocoTestReport + run: ./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT -x integTest -x jacocoTestReport - name: Create Artifact Path run: | mkdir -p index-management-artifacts From b3459f075756bcc9069b05aad7ef4c7225ad41b4 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Thu, 2 Dec 2021 17:18:36 -0800 Subject: [PATCH 10/14] Adds an artifact per build Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 5cb7b9d2d..6ad8e3d74 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -43,7 +43,7 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v1 with: - name: index-management-plugin + name: index-management-plugin-ubuntu path: index-management-artifacts windows-build: # Job name @@ -68,19 +68,21 @@ jobs: run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" -x integTest -x jacocoTestReport env: _JAVA_OPTIONS: -Xmx4096M +# - name: Upload failed logs +# uses: actions/upload-artifact@v2 +# if: failure() +# with: +# name: logs +# path: build/testclusters/integTest-*/logs/* - name: Create Artifact Path run: | mkdir -p index-management-artifacts cp ./build/distributions/*.zip index-management-artifacts - - name: Uploads coverage - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} # 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 + name: index-management-plugin-windows path: index-management-artifacts mac-build: # Job name @@ -98,17 +100,19 @@ jobs: uses: actions/checkout@v2 - name: Build with Gradle run: ./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT -x integTest -x jacocoTestReport +# - name: Upload failed logs +# uses: actions/upload-artifact@v2 +# if: failure() +# with: +# name: logs +# path: build/testclusters/integTest-*/logs/* - name: Create Artifact Path run: | mkdir -p index-management-artifacts cp ./build/distributions/*.zip index-management-artifacts - - name: Uploads coverage - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} # 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 + name: index-management-plugin-mac path: index-management-artifacts \ No newline at end of file From 4e26bd08aa1dfe434dcf7178e358724ad90a2417 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Fri, 3 Dec 2021 14:14:58 -0800 Subject: [PATCH 11/14] Uses 1.3 in mac/windows tests Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 6ad8e3d74..9160a2c55 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -65,7 +65,7 @@ jobs: run: subst 'X:' . - name: Build with Gradle working-directory: 'X:' - run: ./gradlew.bat build -D"opensearch.version=1.2.0-SNAPSHOT" -x integTest -x jacocoTestReport + run: ./gradlew.bat build -D"opensearch.version=1.3.0-SNAPSHOT" -x integTest -x jacocoTestReport env: _JAVA_OPTIONS: -Xmx4096M # - name: Upload failed logs @@ -99,7 +99,7 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle - run: ./gradlew build -Dopensearch.version=1.2.0-SNAPSHOT -x integTest -x jacocoTestReport + run: ./gradlew build -Dopensearch.version=1.3.0-SNAPSHOT -x integTest -x jacocoTestReport # - name: Upload failed logs # uses: actions/upload-artifact@v2 # if: failure() From 0e4a627b96e4182bebf9a18296856a5e2380603c Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Tue, 7 Dec 2021 15:12:57 -0800 Subject: [PATCH 12/14] Refactors to use matrix for os designation Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 110 +++++------------- 1 file changed, 31 insertions(+), 79 deletions(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 9160a2c55..e9db427d0 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -1,5 +1,5 @@ name: Test and Build Workflow -# This workflow is triggered on pull requests to main or a opendistro release branch +# This workflow is triggered on pull requests to main or an opendistro release branch on: pull_request: branches: @@ -7,13 +7,27 @@ on: push: branches: - "*" - jobs: - linux-build: + build: # Job name name: Build Index Management - # This job runs on Linux - runs-on: ubuntu-latest + env: + BUILD_ARGS: -D"opensearch.version=1.3.0-SNAPSHOT" ${{ matrix.os_build_args }} + WORKING_DIR: ${{ matrix.working_directory }}. + strategy: + # This setting says that all jobs should finish, even if one fails + fail-fast: false + # This starts three jobs, with + matrix: + include: + - os: ubuntu-latest + - 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 + runs-on: ${{ matrix.os }} steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - name: Set Up JDK 14 @@ -23,11 +37,19 @@ jobs: # 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 - run: ./gradlew build -Dopensearch.version=1.3.0-SNAPSHOT + working-directory: ${{ env.WORKING_DIR }} + run: ./gradlew build ${{ env.BUILD_ARGS }} + env: + _JAVA_OPTIONS: ${{ matrix.os_java_options }} - name: Upload failed logs uses: actions/upload-artifact@v2 - if: failure() + if: ${{ failure() && matrix.os == 'ubuntu-latest' }} with: name: logs path: build/testclusters/integTest-*/logs/* @@ -36,6 +58,7 @@ jobs: mkdir -p index-management-artifacts cp ./build/distributions/*.zip index-management-artifacts - name: Uploads coverage + if: ${{ matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -43,76 +66,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v1 with: - name: index-management-plugin-ubuntu + name: index-management-plugin-${{ matrix.os }} path: index-management-artifacts - windows-build: - # Job name - name: Build Index Management - # This job runs on Windows - runs-on: windows-latest - steps: - # This step uses the setup-java Github action: https://github.com/actions/setup-java - - name: Set Up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - # 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 - run: subst 'X:' . - - name: Build with Gradle - working-directory: 'X:' - run: ./gradlew.bat build -D"opensearch.version=1.3.0-SNAPSHOT" -x integTest -x jacocoTestReport - env: - _JAVA_OPTIONS: -Xmx4096M -# - name: Upload failed logs -# uses: actions/upload-artifact@v2 -# if: failure() -# with: -# name: logs -# path: build/testclusters/integTest-*/logs/* - - 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-windows - path: index-management-artifacts - mac-build: - # Job name - name: Build Index Management - # This job runs on Mac OS - runs-on: macos-latest - steps: - # This step uses the setup-java Github action: https://github.com/actions/setup-java - - name: Set Up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - # build index management - - name: Checkout Branch - uses: actions/checkout@v2 - - name: Build with Gradle - run: ./gradlew build -Dopensearch.version=1.3.0-SNAPSHOT -x integTest -x jacocoTestReport -# - name: Upload failed logs -# uses: actions/upload-artifact@v2 -# if: failure() -# with: -# name: logs -# path: build/testclusters/integTest-*/logs/* - - 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-mac - path: index-management-artifacts \ No newline at end of file From 97cfabce4c0badf43982aa29ba9aff644f580491 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Tue, 7 Dec 2021 15:16:58 -0800 Subject: [PATCH 13/14] Fixes typo Signed-off-by: Clay Downs --- .github/workflows/test-and-build-workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index e9db427d0..dfc1e4578 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -7,6 +7,7 @@ on: push: branches: - "*" + jobs: build: # Job name @@ -17,7 +18,7 @@ jobs: strategy: # This setting says that all jobs should finish, even if one fails fail-fast: false - # This starts three jobs, with + # This starts three jobs, setting these environment variables uniquely for the different jobs matrix: include: - os: ubuntu-latest From c7d4bb5bf151347b29858bcaaac12e63d49d1ee1 Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Wed, 8 Dec 2021 18:06:23 +0000 Subject: [PATCH 14/14] Removes out of date comment Signed-off-by: Robert Downs --- .github/workflows/test-and-build-workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index dfc1e4578..03838f37a 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -1,5 +1,4 @@ name: Test and Build Workflow -# This workflow is triggered on pull requests to main or an opendistro release branch on: pull_request: branches: