Skip to content

chore(deps)(deps): bump the go-minor-patch group across 1 directory with 3 updates #46

chore(deps)(deps): bump the go-minor-patch group across 1 directory with 3 updates

chore(deps)(deps): bump the go-minor-patch group across 1 directory with 3 updates #46

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
cache: true
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Test (race + coverage)
run: go test -race -coverprofile=cover.out ./...
- name: Coverage report
run: go tool cover -func=cover.out
- name: Coverage gate (≥80% per package + overall)
# block_kit + the conversion-engine packages must each hit at least
# 80% statement coverage, and so must the overall figure. Per-package
# coverage is computed directly from the merged cover profile
# (count covered vs total statements, grouped by package dir) — the
# `go tool cover -func` output has no per-package total line.
run: |
set -euo pipefail
awk 'NR==1{next} {
split($1,a,":"); file=a[1];
n=split(file,p,"/"); dir=p[1];
for (i=2;i<n;i++) dir=dir"/"p[i];
tot[dir]+=$2; if ($3+0>0) cov[dir]+=$2
} END { for (d in tot) printf "%s %.1f\n", d, 100*cov[d]/tot[d] }' cover.out \
| sort > pkgcov.txt
cat pkgcov.txt
fail=0
for pkg in \
github.com/hishamkaram/mcp-slack-block-kit/block_kit \
github.com/hishamkaram/mcp-slack-block-kit/internal/converter \
github.com/hishamkaram/mcp-slack-block-kit/internal/reverse \
github.com/hishamkaram/mcp-slack-block-kit/internal/validator \
github.com/hishamkaram/mcp-slack-block-kit/internal/splitter \
github.com/hishamkaram/mcp-slack-block-kit/internal/preview \
; do
pct=$(awk -v p="$pkg" '$1==p {print $2}' pkgcov.txt)
pct=${pct:-0}
if awk -v t="$pct" 'BEGIN { exit (t+0 >= 80 ? 0 : 1) }'; then
echo "OK: $pkg ${pct}%"
else
echo "FAIL: $pkg coverage ${pct}% is below the 80% gate"
fail=1
fi
done
total=$(go tool cover -func=cover.out | tail -1 | awk '{print $NF}' | tr -d '%')
if awk -v t="$total" 'BEGIN { exit (t+0 >= 80 ? 0 : 1) }'; then
echo "OK: overall ${total}%"
else
echo "FAIL: overall coverage ${total}% is below the 80% gate"
fail=1
fi
exit $fail
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
cache: true
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.12.0
args: --timeout=5m
govulncheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
cache: true
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
- name: Run govulncheck
run: govulncheck ./...
fuzz-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
cache: true
- name: Fuzz splitter (30s smoke)
run: |
set -euo pipefail
cd internal/splitter
go test -run=^$ -fuzz=FuzzSplitText -fuzztime=30s
goreleaser-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
- uses: goreleaser/goreleaser-action@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7.2.1
with:
version: '~> v2'
args: check