-
Notifications
You must be signed in to change notification settings - Fork 12
74 lines (62 loc) · 1.98 KB
/
ci.yaml
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
name: Continuous Integration
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-distributions:
name: Validate distributions
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check unique distributions names
run: ./.github/workflows/scripts/check_distro_names.sh
build:
name: Validate distributions build, third party libraries and security
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22.3'
check-latest: true
- name: Verify build
run: make ci
- name: Validate distributions third party libraries
run: make licenses-check
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
env:
SNYK_TOKEN: ${{ secrets.CAOS_SNYK_TOKEN }}
with:
args: --all-projects --severity-threshold=high
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build binaries & packages with GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: '~> v1'
args: --snapshot --clean --skip-sign --timeout 2h
env:
GORELEASER_CURRENT_TAG: 0.0.0
- name: Extract image version
run: echo "version=$(jq -r '.version' dist/metadata.json)" >> $GITHUB_ENV
- name: Trivy security check
uses: aquasecurity/trivy-action@master
with:
image-ref: "newrelic/nr-otel-collector:${{ env.version }}-rc-amd64"
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: "HIGH,CRITICAL"