forked from CrowdStrike/falcon-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.2 KB
/
operator-metadata.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
name: Operator Metadata Sanity
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
go-version: [1.17.x]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install dependencies
uses: mstksg/get-package@master
with:
apt-get: libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Set-up
run: |
mkdir -p $HOME/go/bin
make operator-sdk
- name: Ensure autogenerated stuff is in the best possible shape
run: |
export PATH=$HOME/go/bin:$PATH
make manifests generate
make bundle
rm deploy/falcon-operator.yaml && make deploy/falcon-operator.yaml
find ./bundle* -type f -exec sed -i -e 's/operator-sdk-v1.16.0+git/operator-sdk-v1.17.0/g' {} \;
if [[ -n $(git status -s) ]] ; then
echo "Generating manifests leaves tracked fields in a modified state."
echo "Ensure to include updated manifests in this PR."
echo "This is usually done by running 'make manifests generate' and running 'git add ...' for the files that was modified by generating manifests."
git status -s
git diff
exit 1
fi
- name: Ensure go modules are tidy
run: |
go mod tidy
if [[ -n $(git status -s) ]] ; then
echo "Running 'go mod tidy' changes the current settinng"
echo "Ensure to include updated go.mod and go.sum in this PR."
echo "This is usually done by running 'go mod tidy'"
git status -s
git diff
exit 1
fi
- name: Ensure go fmt is clean
run: |
make fmt
if [[ -n $(git status -s) ]] ; then
echo "Running 'make fmt' changes the current codebase"
echo "Ensure to include updated codebase in this PR."
echo "This is usually done by running 'make fmt'"
git status -s
git diff
exit 1
fi