-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexecs.flow
More file actions
165 lines (154 loc) · 4.54 KB
/
execs.flow
File metadata and controls
165 lines (154 loc) · 4.54 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# yaml-language-server: $schema=https://flowexec.io/schemas/flowfile_schema.json
tags: [development]
executables:
- verb: validate
description: Run all development checks
serial:
execs:
- ref: generate
- ref: lint
- ref: test tui
- ref: validate generated
- cmd: echo "✅ All development checks passed"
- verb: test
name: tui
aliases: [go]
tags: [go]
description: Run tests with coverage
serial:
dir: //
params:
- envKey: COLORFGBG
text: 15;0
- envKey: COLORTERM
text: truecolor
- envKey: TERM
text: xterm-256color
execs:
- cmd: |
set -e
echo "Running Go unit tests..."
if [ "$CI" = "true" ]; then
echo "Running Go unit tests with coverage..."
go test -race -coverprofile=coverage.out -covermode=atomic ./...
else
go test -race ./...
fi
echo "Unit tests completed"
retries: 3
- verb: generate
tags: [go]
exec:
dir: //
cmd: |
echo "Generating go CLI code..."
go generate ./...
echo "All go code generated successfully"
- verb: validate
name: generated
description: Check for uncommitted generated files
exec:
dir: //
cmd: |
echo "Checking for uncommitted generated files..."
if [ -n "$(git status --porcelain)" ]; then
echo "❌ Generated files are not up to date!"
echo "Please run 'flow generate' and commit the changes."
echo ""
echo "Uncommitted changes:"
git status --porcelain
exit 1
else
echo "✅ All generated files are up to date"
fi
- verb: test
name: snapshot
description: Run the snapshot tests
exec:
dir: //
params:
- envKey: COLORFGBG
text: 15;0
- envKey: COLORTERM
text: truecolor
- envKey: TERM
text: xterm-256color
args:
- envKey: BUILDER
pos: 1
default: podman
cmd: |
$BUILDER run --rm -it -v "$PWD":/go/src/app -w /go/src/app \
-e COLORFGBG=$COLORFGBG -e COLORTERM=$COLORTERM -e TERM=$TERM \
golang:1.23-bookworm go test ./container_test.go
- verb: update
name: snapshot
description: Update the snapshot test golden files
exec:
dir: //
params:
- envKey: COLORFGBG
text: 15;0
- envKey: COLORTERM
text: truecolor
- envKey: TERM
text: xterm-256color
args:
- envKey: BUILDER
pos: 1
default: podman
cmd: |
$BUILDER run --rm -it -v "$PWD":/go/src/app -w /go/src/app \
-e COLORFGBG=$COLORFGBG -e COLORTERM=$COLORTERM -e TERM=$TERM \
golang:1.23-bookworm go test -update ./container_test.go
- verb: run
name: sample
description: Run the sample container program
visibility: hidden # TODO: fix running of tea programs from within the container
exec:
dir: //
args:
- envKey: VIEW
pos: 1
default: frame
logMode: text
cmd: go run ./sample --view $VIEW
- verb: lint
tags: [go]
description: Run linters and formatters
parallel:
dir: //
failFast: false
execs:
- cmd: go fmt ./...
- cmd: go mod tidy
- cmd: |
if ! command -v golangci-lint &> /dev/null; then
echo "Installing golangci-lint..."
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s v2.11.4
export PATH="$PATH:./bin"
fi
if [ "$CI" = "true" ]; then
echo "Running golangci-lint with sarif output..."
golangci-lint run ./... --fix --output.sarif.path lint.sarif
else
golangci-lint run ./... --fix
fi
- verb: scan
name: security
tags: [security, go]
description: Run security scanning with govulncheck
exec:
dir: //
cmd: |
if ! command -v govulncheck &> /dev/null; then
echo "Installing govulncheck..."
go install golang.org/x/vuln/cmd/govulncheck@latest
fi
if [ "$CI" = "true" ]; then
govulncheck -format sarif ./... > govuln.sarif
echo "Security scan completed. Results saved to govuln.sarif"
else
govulncheck ./...
echo "Security scan completed. No vulnerabilities found."
fi