-
Notifications
You must be signed in to change notification settings - Fork 798
78 lines (76 loc) · 2.31 KB
/
codegen.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
78
name: Generated code
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
env:
# Golang version to use
GOLANG_VERSION: 1.19
# Version of operator-sdk binary
SDK_VERSION: 1.11.0
# Checksum of operator-sdk binary
SDK_CHECKSUM: 'b1f6fb02c619cfcdb46edf41cbeb4d66f627fd8bba122edaeeb06718965299eb'
jobs:
check-go-modules:
name: "Check for go.mod/go.sum synchronicity"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v1
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Download all Go modules
run: |
go mod download
- name: Check for tidyness of go.mod and go.sum
run: |
go mod tidy
git diff --exit-code -- .
check-sdk-codegen:
name: "Check for changes from make bundle"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v1
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Download and install Operator SDK
run: |
set -ue
set -o pipefail
curl -sLf --retry 3 \
-o /tmp/operator-sdk_linux_amd64 \
https://github.com/operator-framework/operator-sdk/releases/download/v1.11.0/operator-sdk_linux_amd64
calculated=$(sha256sum /tmp/operator-sdk_linux_amd64 | awk '{print $1}')
if test "${calculated}" != "${SDK_CHECKSUM}"; then
echo "FAILED TO VALIDATE CHECKSUM" >&2
echo "Download is: ${calculated}"
echo "Should: ${SDK_CHECKSUM}"
exit 1
fi
sudo install -m 0755 /tmp/operator-sdk_linux_amd64 /usr/local/bin/operator-sdk
- name: Run make bundle
run: |
make bundle
- name: Ensure there is no diff in bundle
run: |
git diff --exit-code -- .
- name: Run make generate
run: |
make generate
- name: Ensure there is no diff in generated assets
run: |
git diff --exit-code -- .
- name: Run make manifests
run: |
make manifests
- name: Ensure there is no diff in manifests
run: |
git diff --exit-code -- .