-
Notifications
You must be signed in to change notification settings - Fork 19
77 lines (69 loc) · 2.12 KB
/
build-dev.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
75
76
77
name: Build, Test, and Lint
on:
push:
branches:
- main
- 'release-*'
pull_request_target:
jobs:
build-container:
runs-on: ubuntu-latest
env:
EXPORT_RESULT: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: "true"
- uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test build
run: devbox run -- make build
- name: Run unit tests
run: devbox run -- make unit-test
# gocov-xml expects things to be properly placed under go path.
# GHA clones into /home/runner/work/repository so we create
# the directory under the right path and link it
- run: mkdir -p /home/runner/go/src/github.com/nutanix-cloud-native/ && ln -s /home/runner/work/cloud-provider-nutanix/cloud-provider-nutanix /home/runner/go/src/github.com/nutanix-cloud-native
- name: Run coverage report
run: devbox run -- make coverage
- name: Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml # Replace with the path to your coverage report
fail_ci_if_error: true
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
scan-type: "fs"
ignore-unfixed: true
format: "table"
exit-code: "1"
vuln-type: "os,library"
severity: "CRITICAL,HIGH"
e2e:
strategy:
matrix:
e2e-labels:
- "capx"
fail-fast: false
uses: ./.github/workflows/e2e.yaml
with:
e2e-labels: ${{ matrix.e2e-labels }}
secrets: inherit
permissions:
contents: read
checks: write