Skip to content

Commit

Permalink
Enable custom start commands and options to resolve GHA issues (#676)
Browse files Browse the repository at this point in the history
* Enable custom start commands and options to resolve GHA issues

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Enable custom start commands and options to resolve GHA issues

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Enable custom start commands and options to resolve GHA issues

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

---------

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored Nov 18, 2024
1 parent a85d9df commit 8caf59c
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,11 @@ jobs:
# 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

# actions/checkout@v4 and actions/setup-java@v4 use node 20:
# https://github.com/actions/checkout/releases/tag/v4.0.0
# container image does not have GLIBC_2.28 required for this node version
# as such use @v3 actions instead for this workflow and set ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}

steps:
- name: Run start commands
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set up JDK ${{ matrix.java }} for build and test
uses: actions/setup-java@v3
Expand All @@ -48,7 +43,7 @@ jobs:
java-version: ${{ matrix.java }}
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build with Gradle
id: step-build-test-linux
run: |
Expand All @@ -62,7 +57,7 @@ jobs:
uses: codecov/codecov-action@v1.2.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: async-plugin-linux-${{ matrix.java }}
path: ${{ steps.step-build-test-linux.outputs.build-test-linux }}
Expand All @@ -78,9 +73,6 @@ jobs:
# This job runs on Linux.
runs-on: ubuntu-latest

env: # actions/checkout uses node 16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK ${{ matrix.java }}
Expand All @@ -89,8 +81,8 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.java }}
- name: Checkout Branch
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: async-plugin-linux-${{ matrix.java }}
- name: Pull and Run Docker for security tests
Expand Down Expand Up @@ -144,7 +136,7 @@ jobs:
./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster"
fi
- name: Upload failed logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
Expand All @@ -168,7 +160,7 @@ jobs:
java-version: ${{ matrix.java }}
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build with Gradle
run: ./gradlew.bat build -x integTest -x jacocoTestReport
env:
Expand All @@ -179,7 +171,7 @@ jobs:
cp ./build/distributions/*.zip asynchronous-search-artifacts
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: asynchronous-search-plugin-windows
path: asynchronous-search-artifacts
Expand All @@ -202,7 +194,7 @@ jobs:
java-version: ${{ matrix.java }}
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build with Gradle
run: ./gradlew build -x integTest -x jacocoTestReport
env:
Expand All @@ -213,7 +205,7 @@ jobs:
cp ./build/distributions/*.zip asynchronous-search-artifacts
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: asynchronous-search-plugin-mac
path: asynchronous-search-artifacts

0 comments on commit 8caf59c

Please sign in to comment.