-
Notifications
You must be signed in to change notification settings - Fork 176
66 lines (64 loc) · 1.95 KB
/
ci-collector.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
name: "Continuous Build (Collector)"
on:
push:
paths:
- 'collector/**'
- '.github/workflows/ci-collector.yml'
branches:
- main
pull_request:
paths:
- 'collector/**'
- '.github/workflows/ci-collector.yml'
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '~1.21.9'
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tidy
run: make gotidy
working-directory: collector
- name: Run tests
run: make gotest
working-directory: collector
build:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
architecture: [ amd64, arm64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '~1.21.9'
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Collector Executable for ${{ matrix.architecture }} architecture
run: GOARCH=${{ matrix.architecture }} make package
working-directory: collector
- name: Get Lambda Layer amd64 architecture value
if: ${{ matrix.architecture == 'amd64' }}
run: echo LAMBDA_LAYER_ARCHITECTURE=x86 | tee --append $GITHUB_ENV
- name: Get Lambda Layer arm64 architecture value
if: ${{ matrix.architecture == 'arm64' }}
run: echo LAMBDA_LAYER_ARCHITECTURE=ARM | tee --append $GITHUB_ENV
- name: Confirm architecture of built collector
working-directory: collector/build/extensions
run: |
grep ${{ env.LAMBDA_LAYER_ARCHITECTURE }} <<< "$(file collector)"