-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (100 loc) · 3.63 KB
/
Copy pathci.yaml
File metadata and controls
107 lines (100 loc) · 3.63 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: ci
on:
push:
# automation/** is here because upstream-sync pushes those branches over SSH.
# A PR it opens cannot fire pull_request, but the push can, and the checks
# land on the same commit either way.
branches: [main, "automation/**"]
pull_request:
# A CVE published after a merge is still our problem, so rescan daily.
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- run: gofmt -l cmd internal pkg | tee /dev/stderr | (! read)
- run: go vet ./...
- name: go vet (linux)
run: GOOS=linux go vet ./...
- run: go test -race ./...
# Read from a plain file so the upstream-sync workflow can bump it without a
# token carrying the workflow scope.
- id: lint-version
run: echo "version=$(cat hack/golangci-lint.version)" >> "$GITHUB_OUTPUT"
- uses: golangci/golangci-lint-action@v9
with:
version: ${{ steps.lint-version.outputs.version }}
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Reachability-aware, so it only fails on vulnerabilities we actually call.
# It installs its own Go, hence no setup-go step; go-version-input must be
# cleared or it collides with go-version-file.
- uses: golang/govulncheck-action@v1.1.0
with:
repo-checkout: false
go-version-file: go.mod
go-version-input: ""
# Source-tree scan: go.sum against the vulnerability databases trivy tracks,
# plus committed secrets. Misconfig scanning is off: a node CSI driver is
# privileged and hostPath-mounted by design, and every hit would be a waiver.
- uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: fs
scan-ref: .
scanners: vuln,secret
format: table
exit-code: "1"
ignore-unfixed: true
severity: CRITICAL,HIGH
# Real overlayfs and mergerfs mounts. The runner is a VM with its own kernel, so
# a privileged container is enough; no nested VM is involved.
mount:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: test -c /dev/fuse || (echo "runner has no /dev/fuse" >&2; exit 1)
- run: make test-mount
helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: azure/setup-helm@v5
- run: helm lint charts/union-csi-driver
- name: helm template (both backends)
run: |
helm template ci charts/union-csi-driver --set backend=mergerfs > /dev/null
helm template ci charts/union-csi-driver --set backend=overlay > /dev/null
- uses: helm/chart-testing-action@v2
# The released chart version comes from the git tag, not Chart.yaml, so
# demanding a version bump per chart change would be asking for a no-op edit.
- run: ct lint --target-branch ${{ github.event.repository.default_branch }} --chart-dirs charts --check-version-increment=false
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v7
with:
context: .
push: false
load: true
tags: union-csi-driver:ci
- uses: aquasecurity/trivy-action@v0.36.0
with:
image-ref: union-csi-driver:ci
format: table
exit-code: "1"
ignore-unfixed: true
severity: CRITICAL,HIGH