-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
140 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Setup Environment | ||
description: Sets up the environment to build/test the agent. | ||
# This action expects the agent to be checked out at $GITHUB_WORKSPACE. | ||
# It will also set up the instrumentation jar zip if AWS credentials are set. | ||
# This action requires these because composite actions cannot use secrets and | ||
# for a composite action to be run, the repo must be checked out. | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Set up Javas | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: | | ||
20 | ||
17 | ||
11 | ||
8 | ||
- name: Check Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: set gradle.properties | ||
shell: bash | ||
run: | | ||
sed -i -e "s|jdk8=8|jdk8=${JAVA_HOME_8_X64}| | ||
s|jdk11=11|jdk11=${JAVA_HOME_11_X64}| | ||
s|jdk17=17|jdk17=${JAVA_HOME_17_X64}| | ||
s|jdk20=20|jdk20=${JAVA_HOME_20_X64}|" gradle.properties.gha | ||
cat gradle.properties.gha >> gradle.properties | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Setup Gradle options | ||
shell: bash | ||
run: echo "GRADLE_OPTIONS=--console=plain --parallel -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64,JAVA_HOME_20_X64" >> $GITHUB_ENV | ||
|
||
- name: Download S3 instrumentation jar zip | ||
shell: bash | ||
run: | | ||
aws s3 cp s3://nr-java-agent-s3-instrumentation/proprietary-jars-20220805.zip proprietary-jars.zip && unzip proprietary-jars.zip | ||
if [ $? -ne 0 ]; then | ||
echo "Instrumentation jar zip unavailable." >> $GITHUB_STEP_SUMMARY | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,109 +30,42 @@ jobs: | |
matrix: | ||
java-version: [ 8, 11, 17, 20 ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout Java agent | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.agent-ref || github.ref || 'main' }} | ||
#- uses: gradle/[email protected] | ||
|
||
- name: Set up Java 8 | ||
# https://github.com/actions/setup-java | ||
uses: actions/setup-java@v3 | ||
- name: Configure AWS Credentials | ||
if: ${{ env.AWS_KEY != '' }} | ||
uses: aws-actions/configure-aws-credentials@v1-node16 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 8 | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-2 | ||
|
||
- name: Save JAVA_HOME as JDK8 for later usage | ||
run: | | ||
echo "Current JAVA_HOME = ${JAVA_HOME}" | ||
echo "ORG_GRADLE_PROJECT_jdk8=$JAVA_HOME" >> $GITHUB_ENV | ||
- name: Set up Java 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
|
||
- name: Save JAVA_HOME as JDK11 for later usage | ||
run: | | ||
echo "Current JAVA_HOME = ${JAVA_HOME}" | ||
echo "ORG_GRADLE_PROJECT_jdk11=$JAVA_HOME" >> $GITHUB_ENV | ||
- name: Set up Java 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
|
||
- name: Save JAVA_HOME as JDK17 for later usage | ||
run: | | ||
echo "Current JAVA_HOME = ${JAVA_HOME}" | ||
echo "ORG_GRADLE_PROJECT_jdk17=$JAVA_HOME" >> $GITHUB_ENV | ||
# Install latest non-LTS Java version (we should only ever test one non-LTS version to keep test times reasonable) | ||
- name: Set up Java 20 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 20 | ||
|
||
- name: Save JAVA_HOME as JDK20 for later usage | ||
run: | | ||
echo "Current JAVA_HOME = ${JAVA_HOME}" | ||
echo "ORG_GRADLE_PROJECT_jdk20=$JAVA_HOME" >> $GITHUB_ENV | ||
- name: Check environmental variables | ||
run: printenv | sort -f | ||
|
||
- name: Set gradle.properties | ||
run: | | ||
sed -i -e "s|jdk8=8|jdk8=${ORG_GRADLE_PROJECT_jdk8}| | ||
s|jdk11=11|jdk11=${ORG_GRADLE_PROJECT_jdk11}| | ||
s|jdk17=17|jdk17=${ORG_GRADLE_PROJECT_jdk17}| | ||
s|jdk20=20|jdk20=${ORG_GRADLE_PROJECT_jdk20}|" gradle.properties.gha | ||
cat gradle.properties.gha | ||
rm gradle.properties | ||
mv gradle.properties.gha gradle.properties | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Setup environment | ||
uses: ./.github/actions/setup-environment | ||
|
||
- name: Build newrelicJar | ||
env: | ||
JAVA_HOME: ${{ env.ORG_GRADLE_PROJECT_jdk8 }} | ||
run: | | ||
echo "*** NOT PUBLISHING BUILD SCANS ***" | ||
ls -la | ||
cat settings.gradle | ||
./gradlew clean jar --parallel | ||
ls -la newrelic-agent/build/ | ||
run: ./gradlew $GRADLE_OPTIONS clean jar | ||
|
||
- name: Run functional tests on ${{ matrix.java-version }} (attempt 1) | ||
id: run_tests_1 | ||
continue-on-error: true | ||
timeout-minutes: 50 | ||
env: | ||
JAVA_HOME: ${{ env.ORG_GRADLE_PROJECT_jdk8 }} | ||
run: | | ||
./gradlew --console=plain --parallel :functional_test:test -Ptest${{ matrix.java-version }} --continue | ||
run: ./gradlew $GRADLE_OPTIONS :functional_test:test -Ptest${{ matrix.java-version }} --continue | ||
|
||
- name: Run functional tests on ${{ matrix.java-version }} (attempt 2) | ||
id: run_tests_2 | ||
continue-on-error: true | ||
timeout-minutes: 50 | ||
if: steps.run_tests_1.outcome == 'failure' | ||
env: | ||
JAVA_HOME: ${{ env.ORG_GRADLE_PROJECT_jdk8 }} | ||
run: | | ||
./gradlew --console=plain --parallel :functional_test:test -Ptest${{ matrix.java-version }} --continue | ||
run: ./gradlew $GRADLE_OPTIONS :functional_test:test -Ptest${{ matrix.java-version }} --continue | ||
|
||
- name: Run functional tests on ${{ matrix.java-version }} (attempt 3) | ||
timeout-minutes: 50 | ||
if: steps.run_tests_2.outcome == 'failure' | ||
env: | ||
JAVA_HOME: ${{ env.ORG_GRADLE_PROJECT_jdk8 }} | ||
run: | | ||
./gradlew --console=plain --parallel :functional_test:test -Ptest${{ matrix.java-version }} --continue | ||
run: ./gradlew $GRADLE_OPTIONS :functional_test:test -Ptest${{ matrix.java-version }} --continue | ||
|
||
- name: Capture build reports | ||
if: ${{ failure() }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.