-
Notifications
You must be signed in to change notification settings - Fork 172
79 lines (77 loc) · 2.31 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
67
68
69
70
71
72
73
74
75
76
77
78
79
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:
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.19.4'
- uses: actions/cache@v3
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
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.19.4'
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make gotest
working-directory: collector
build:
runs-on: ubuntu-latest
needs: [test, tidy]
strategy:
matrix:
architecture: [ amd64, arm64 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.19.4'
- uses: actions/cache@v3
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)"