-
Notifications
You must be signed in to change notification settings - Fork 2
150 lines (128 loc) · 4.1 KB
/
quality.yml
File metadata and controls
150 lines (128 loc) · 4.1 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
name: Code Quality
on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]
permissions:
contents: read
pull-requests: read
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
shellcheck:
name: Shell Script Linting
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: '.'
ignore_paths: 'node_modules .git'
severity: warning # Only fail on warnings and errors, not info
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.0'
cache: true
- name: Set up buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate protobuf files
run: buf generate
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.9.0
args: --timeout=5m --config=.golangci.yml
tiltfile-syntax:
name: Tiltfile Syntax
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Tilt
run: |
# Use VERSION env var with master script (recommended approach)
# Retry up to 3 times to handle transient GitHub release download issues
for i in 1 2 3; do
if curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | VERSION=0.36.0 bash; then
echo "Tilt installed successfully on attempt $i"
exit 0
fi
echo "Attempt $i failed, retrying in 10 seconds..."
sleep 10
done
echo "Failed to install Tilt after 3 attempts"
exit 1
timeout-minutes: 3
- name: Create minimal kubeconfig
run: |
# Tilt requires a kubeconfig even for syntax validation
mkdir -p ~/.kube
cat > ~/.kube/config <<'EOF'
apiVersion: v1
kind: Config
clusters:
- cluster:
server: https://127.0.0.1:6443
name: kind-meridian-local
contexts:
- context:
cluster: kind-meridian-local
user: kind-meridian-local
name: kind-meridian-local
current-context: kind-meridian-local
users:
- name: kind-meridian-local
EOF
- name: Validate Tiltfile syntax
run: |
# Run tilt ci with a short timeout to validate syntax
set +e
timeout 10s tilt ci 2>&1 | tee tilt-output.txt
EXIT_CODE=$?
set -e
# Check for syntax errors
if grep -q "got illegal token\|syntax error\|Traceback (most recent call last)" tilt-output.txt; then
echo "❌ Tiltfile has syntax errors!"
grep -A 5 "got illegal token\|syntax error\|Traceback" tilt-output.txt || true
exit 1
fi
# Check if it loaded successfully
if grep -q "Successfully loaded Tiltfile" tilt-output.txt; then
echo "✅ Tiltfile syntax is valid!"
exit 0
fi
# Timeout is expected without a real cluster
if [ $EXIT_CODE -eq 124 ]; then
if grep -q "Loading Tiltfile" tilt-output.txt; then
echo "✅ Tiltfile syntax is valid!"
exit 0
fi
fi
echo "❌ Unexpected validation result"
cat tilt-output.txt
exit 1
timeout-minutes: 1
- name: Upload validation output
if: failure()
uses: actions/upload-artifact@v7
with:
name: tilt-validation-output
path: tilt-output.txt
retention-days: 7