-
Notifications
You must be signed in to change notification settings - Fork 162
49 lines (44 loc) · 1.68 KB
/
X-Reusable-BuildAgent.yml
File metadata and controls
49 lines (44 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build agent
on:
workflow_call:
inputs:
agent-ref:
required: true
default: main
type: string
description: 'The ref (branch, SHA, tag?) to run the tests on'
gradle-cache-read-only:
required: false
default: true
type: boolean
description: 'Whether the gradle cache should be read only'
jobs:
# build the agent and saves Gradle's cache so all modules can use the cache
build-agent:
runs-on: ubuntu-24.04
env:
# we use this in env var for conditionals (secrets can't be used in conditionals)
AWS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
steps:
- name: Checkout Java agent
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4
with:
ref: ${{ inputs.agent-ref }}
- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Setup environment
uses: ./.github/actions/setup-environment
with:
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}
- name: Build agent
run: ./gradlew $GRADLE_OPTIONS clean jar
- name: Cache agent
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # pin@v4.2.0 # pin@v4
with:
path: /home/runner/work/newrelic-java-agent/newrelic-java-agent/newrelic-agent/build/newrelicJar/newrelic.jar
key: agent-jar-${{ github.run_id }}