Skip to content

Commit

Permalink
Migrate Workflows to use Node 20 (#1847)
Browse files Browse the repository at this point in the history
* update actions to use node 20

* update download-artifact action to v3, added env 

* update gradle-build action
  • Loading branch information
deleonenriqueta authored Apr 12, 2024
1 parent 402ecf2 commit a844a91
Show file tree
Hide file tree
Showing 20 changed files with 82 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:

steps:
- name: Set up Javas
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
Expand All @@ -33,7 +33,7 @@ runs:
cat gradle.properties.gha >> gradle.properties
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ inputs.gradle-cache-read-only }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Create-Custom-Jar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
steps:

- name: Checkout Java agent
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -45,7 +45,7 @@ jobs:
echo "This jar was built from the ref (branch/tag/hash): ${{ inputs.ref }}." >> $GITHUB_STEP_SUMMARY
- name: Capture custom jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: custom-newrelic-jar
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/GHA-Functional-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
java-version: [8, 11, 17, 21]
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

- name: Capture build reports
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: functional-tests-results-java-${{ matrix.java-version }}
# The regex for the path below will capture functional test HTML reports generated by gradle for all
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/GHA-Scala-Functional-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
java-version: [8, 11]
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Capture Jacoco reports
if: matrix.java-version == '11'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jacoco-reports-java-${{ matrix.java-version }}
path: |
Expand All @@ -81,7 +81,7 @@ jobs:
# Capture HTML build result in artifacts
- name: Capture build reports
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: functional-tests-results-java-${{ matrix.java-version }}
# The regex for the path below will capture functional test HTML reports generated by gradle for all
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/GHA-Scala-Instrumentation-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
scala: 2.11
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/GHA-Spotbugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -40,37 +40,37 @@ jobs:
- name: Execute Spotbugs
run: ./gradlew $GRADLE_OPTIONS spotbugsMain

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: all-spotbugs-results
path: '**/build/spotbugs/main.*'
retention-days: 5

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: newrelic-agent-spotbugs-results
path: 'newrelic-agent/build/spotbugs/main.*'
retention-days: 5

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: newrelic-weaver-spotbugs-results
path: 'newrelic-weaver/build/spotbugs/main.*'
retention-days: 5

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: agent-bridge-spotbugs-results
path: 'agent-bridge/build/spotbugs/main.*'
retention-days: 5

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: agent-model-spotbugs-results
path: 'agent-model/build/spotbugs/main.*'
retention-days: 5

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: newrelic-api-spotbugs-results
path: 'newrelic-api/build/spotbugs/main.*'
Expand All @@ -85,7 +85,7 @@ jobs:
steps:

- name: Checkout GhPages branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'gh-pages'
Expand All @@ -101,31 +101,31 @@ jobs:
# Download reports
- name: Download spotbugs reports 1
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: newrelic-agent-spotbugs-results
path: gh-pages/spotbugs/${{ env.BRANCH_NAME }}/newrelic-agent-spotbugs-results

- name: Download spotbugs reports 2
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: newrelic-weaver-spotbugs-results
path: gh-pages/spotbugs/${{ env.BRANCH_NAME }}/newrelic-weaver-spotbugs-results

- name: Download spotbugs reports 3
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: agent-bridge-spotbugs-results
path: gh-pages/spotbugs/${{ env.BRANCH_NAME }}/agent-bridge-spotbugs-results

- name: Download spotbugs reports 4
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: agent-model-spotbugs-results
path: gh-pages/spotbugs/${{ env.BRANCH_NAME }}/agent-model-spotbugs-results

- name: Download spotbugs reports 5
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: newrelic-api-spotbugs-results
path: gh-pages/spotbugs/${{ env.BRANCH_NAME }}/newrelic-api-spotbugs-results
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/GHA-Unit-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
java-version: [8, 11, 17, 21]
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -63,15 +63,15 @@ jobs:

- name: Upload coverage to Codecov
if: matrix.java-version == '17'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '**/build/reports/jacoco/test/jacocoTestReport.xml'
fail_ci_if_error: false #default is false, but being explicit about what to expect.

- name: Capture Jacoco reports
if: matrix.java-version == '17'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: non-forked-jacoco-reports-java-${{ matrix.java-version }}
path: |
Expand All @@ -80,7 +80,7 @@ jobs:
- name: Capture build reports (non forked)
# If previous step fails, run this step regardless
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: non-forked-tests-results-java-${{ matrix.java-version }}
# The regex for the path below will capture unit test HTML reports generated by gradle for all
Expand Down Expand Up @@ -111,23 +111,23 @@ jobs:

- name: Upload coverage to Codecov
if: matrix.java-version == '17'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '**/build/reports/jacoco/test/jacocoTestReport.xml'
fail_ci_if_error: false #default is false, but being explicit about what to expect.

- name: Capture Jacoco reports
if: matrix.java-version == '17'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: forked-jacoco-reports-java-${{ matrix.java-version }}
path: |
**/build/reports/jacoco/**
- name: Capture build reports (forked)
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: forked-tests-results-java-${{ matrix.java-version }}
# The regex for the path below will capture unit test HTML reports generated by gradle for all
Expand All @@ -139,7 +139,7 @@ jobs:
- name: Checkout GhPages branch
if: ${{ failure() }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'gh-pages'
Expand All @@ -152,14 +152,14 @@ jobs:
- name: Download test reports Java ${{ matrix.java-version }}
if: ${{ failure() }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: unit-tests-results-java-${{ matrix.java-version }}
path: gh-pages/reports/${{ inputs.agent-ref }}/${{ github.run_id }}/unit-tests-results-java-${{ matrix.java-version }}

- name: Set up Python
if: ${{ failure() }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5

#This step executes a Python script that reads and writes html.
#The script requires the beautifulsoup dependency, which parses html.
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
steps:

- name: Checkout GhPages branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'gh-pages'
Expand All @@ -198,7 +198,7 @@ jobs:
git config --global user.email "[email protected]"
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5

- name: Generate Index Pages
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/GHPages-Cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
DAYS: ${{ inputs.days || '5' }}
steps:
- name: Checkout GH Pages
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'gh-pages'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Java-Instrumentation-Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
AWS_KEY: ${{ secrets.aws-secret-access-key }}
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}

- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
# Capture HTML build result in artifacts
- name: Capture build reports
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: instrumentation-tests-results-java-${{ matrix.java-version }}
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Release-CopyToS3-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Self
uses: actions/checkout@v3
uses: actions/checkout@v4
# This always checkouts main. So the script will be run from main.

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEFAULT }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEFAULT }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Release-CopyToS3-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Self
uses: actions/checkout@v3
uses: actions/checkout@v4
# This always checkouts main. So the script will be run from main.

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }}
Expand Down
Loading

0 comments on commit a844a91

Please sign in to comment.