-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (74 loc) · 2.13 KB
/
Copy pathtest.yml
File metadata and controls
87 lines (74 loc) · 2.13 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
76
77
78
79
80
81
82
83
84
85
86
87
name: Build Test and Lint
on:
workflow_dispatch:
pull_request:
push:
branches:
- 'main'
- 'release-*.*'
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Checkout code
# https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@v5
# Setup GoLang build environment
# https://github.com/actions/setup-go
- name: Set up Go 1.x
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
# Download dependencies
- run: go mod download
# Build Go binary
- run: go build -v cmd/main.go
- run: go test ./...
lint:
name: Lint
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Checkout code
# https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@v5
# Setup GoLang build environment
# https://github.com/actions/setup-go
- name: Set up Go 1.x
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- name: Install Helm
uses: azure/setup-helm@v3.5
# Run Go linters
# https://github.com/golangci/golangci-lint-action
- name: Run linters
uses: golangci/golangci-lint-action@v7
with:
version: v2.12.2
- name: Regenerate CRDs
run: make generate manifests
- name: Check for CRD drift
run: |
git diff --compact-summary --exit-code -- config/crd deploy/charts || \
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate manifests' and commit."; exit 1)
- name: Lint Helm manifests
run: make lint-manifests
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Dependency Review
uses: actions/dependency-review-action@v5
with:
fail-on-severity: critical