-
Notifications
You must be signed in to change notification settings - Fork 13
76 lines (63 loc) · 2.02 KB
/
build.yml
File metadata and controls
76 lines (63 loc) · 2.02 KB
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
name: build
on: [push, pull_request]
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
if: >
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' )
env:
GO111MODULE: on
TARGET: amd64
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: 1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: install goberalls
run: go get github.com/mattn/goveralls
- name: Run Revive Action by pulling pre-built image
uses: docker://morphy/revive-action:v2
with:
exclude: "./vendor/..."
- name: gofmt
run: go fmt ./...
- name: go vet
run: go vet ./...
- name: go test
run: go test ./...
- name: Build
run: GOARCH="${TARGET}" go build ./cmd/example
# TBD:
# - name: Go test
# run: sudo ./test.sh
#
# - name: goveralls
# uses: shogo82148/actions-goveralls@v1
# with:
# path-to-profile: coverage.out
verify-crd:
name: Verify CRD is up-to-date
runs-on: ubuntu-latest
if: >
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' )
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Check out code
uses: actions/checkout@v4
- name: Verify CRD is up-to-date
run: |
./hack/update-crdgen.sh
if ! git diff --quiet scheme.yml; then
echo "ERROR: CRD scheme.yml is out of date. Please run './hack/update-crdgen.sh' and commit the changes."
git diff scheme.yml
exit 1
fi