-
Notifications
You must be signed in to change notification settings - Fork 14
109 lines (92 loc) · 2.6 KB
/
pull_request.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: pull request checks
on:
pull_request:
branches: ['*']
jobs:
check-license:
runs-on: ubuntu-24.04
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
- name: Check License Header
uses: apache/skywalking-eyes@cd7b195c51fd3d6ad52afceb760719ddc6b3ee91
build-lint-test:
name: Build (Go ${{ matrix.go }} - ${{ matrix.arch.arch }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
go: ['1.22']
arch:
- arch: amd64
filename: linux-x86_64
- arch: arm64
filename: linux-arm64
- arch: ppc64le
filename: linux-ppc64le
- arch: s390x
filename: linux-s390x
steps:
- name: Install go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Checkout bpfman-operator
uses: actions/checkout@v4
- name: Check format
if: ${{ matrix.arch.arch == 'amd64' }}
run: make fmt && git add -A && git diff --exit-code
- name: Build Operator and Agent
run: GOARCH=${{ matrix.arch.arch }} make build
- name: Run lint
if: ${{ matrix.arch.arch == 'amd64' }}
run: make lint
- name: Verify Autogenerated Code
if: ${{ matrix.arch.arch == 'amd64' }}
run: make verify
- name: Run test
if: ${{ matrix.arch.arch == 'amd64' }}
run: make test
- name: Archive Go code coverage results
if: ${{ matrix.arch.arch == 'amd64' && matrix.go == '1.22' }}
uses: actions/upload-artifact@v4
with:
name: coverage-go
path: cover.out
if-no-files-found: error
- name: Check clean vendors
if: ${{ matrix.arch.arch == 'amd64' }}
run: go mod vendor
- name: Verify generated bundle manifest
if: ${{ matrix.arch.arch == 'amd64' }}
run: |
make bundle
git diff --exit-code -I'^ createdAt: ' bundle
coverage:
needs: [build-lint-test]
runs-on: ubuntu-24.04
steps:
- name: Download golang coverage artifacts
uses: actions/download-artifact@v4
with:
name: coverage-go
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cover.out
flags: unittests
fail_ci_if_error: false
verbose: true
build-workflow-complete:
needs:
[
check-license,
build-lint-test,
coverage,
]
runs-on: ubuntu-24.04
steps:
- name: Build Complete
run: echo "Build Complete"