-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.75 KB
/
Copy pathci.yml
File metadata and controls
56 lines (54 loc) · 1.75 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
name: ci
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.26.1"
- run: sudo apt-get update && sudo apt-get install -y libpam0g-dev
- run: go test ./...
- run: go test -race ./...
- run: go vet ./...
- run: go test ./... -coverprofile=cover.out
- run: |
total=$(go tool cover -func=cover.out | awk '/^total:/ {gsub("%","",$3); print $3}')
echo "total coverage: ${total}%"
awk -v total="$total" 'BEGIN { exit (total >= 80 ? 0 : 1) }'
- run: |
go test -cover ./... | tee package-cover.out
awk '
/coverage: [0-9.]+% of statements/ {
match($0, /coverage: ([0-9.]+)% of statements/, m)
cov = m[1] + 0
pkg = $2
print pkg ": " cov "%"
if (cov < 60) {
bad = 1
print "package below 60% coverage: " pkg > "/dev/stderr"
}
}
END { exit bad }
' package-cover.out
- run: go test ./tests/benchmarks -run '^$' -bench . -benchtime=1x
- run: bash scripts/build.sh
- run: |
test -f scripts/completions/concave.bash
test -f scripts/completions/concave.zsh
test -f scripts/completions/concave.fish
- run: |
size=$(stat -c%s concave)
echo "binary size: ${size} bytes"
test "$size" -le 20000000
- run: |
if command -v golangci-lint >/dev/null 2>&1; then
golangci-lint run ./...
else
echo "golangci-lint not installed; skipping"
fi