-
Notifications
You must be signed in to change notification settings - Fork 56
86 lines (82 loc) · 2.73 KB
/
pr-build.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: PR Build
on:
pull_request:
branches: [ main ]
permissions:
id-token: write
contents: read
jobs:
build-artifacts:
runs-on: ubuntu-20.04
name: Build artifacts - ${{ matrix.language }}
strategy:
matrix:
language: [ java, nodejs, python, dotnet, go ]
build_command: [ ./build.sh ]
architecture: [ amd64, arm64 ]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v5
with:
go-version: '~1.21.10'
check-latest: true
- uses: actions/setup-java@v4
if: ${{ matrix.language == 'java' }}
with:
distribution: corretto
java-version: '17'
- name: Cache (Java)
uses: actions/cache@v3
if: ${{ matrix.language == 'java' }}
with:
path: |
~/go/pkg/mod
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/setup-node@v4
if: ${{ matrix.language == 'nodejs' }}
with:
node-version: '16'
- name: Cache (NodeJS)
uses: actions/cache@v3
if: ${{ matrix.language == 'nodejs' }}
with:
path: |
~/go/pkg/mod
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/setup-python@v5
if: ${{ matrix.language == 'python' }}
with:
python-version: '3.x'
- name: Cache (Python)
uses: actions/cache@v3
if: ${{ matrix.language == 'python' }}
with:
path: |
~/go/pkg/mod
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/setup-dotnet@v4
if: ${{ matrix.language == 'dotnet' }}
with:
dotnet-version: '6.0.405'
- name: Patch ADOT
run: ./patch-upstream.sh
- name: Build layers / sample functions
if: ${{ matrix.language != 'dotnet' && matrix.language != 'go' }}
run: GOARCH=${{ matrix.architecture }} ${{ matrix.build_command }} ${{ matrix.architecture }}
working-directory: ${{ matrix.language }}
- name: Build collector
if: ${{ matrix.language == 'dotnet' || matrix.language == 'go' }}
run: GOARCH=${{ matrix.architecture }} make package
working-directory: opentelemetry-lambda/collector