Compare commits

...

7 Commits

Author SHA1 Message Date
6aed479650 Merge branch 'next' into add-make-check 2026-03-01 23:58:56 +01:00
user
1535c09da5 move 'make check' into Dockerfile, simplify CI to just 'docker build .'
Per reviewer feedback: the Dockerfile now runs 'make check' early in
its build process (after dependencies are extracted). The CI workflow
is simplified to just run 'docker build .', which implicitly runs
'make check' as part of the Docker build.
2026-02-28 10:24:49 -08:00
user
ae0e96eba3 refactor: split check into check-fmt, lint, test targets
make check now depends on check-fmt, lint, and test as prerequisites,
each runnable independently.
2026-02-20 03:17:38 -08:00
4f7459d509 security: pin all go install refs to commit SHAs 2026-02-20 03:16:53 -08:00
user
b19dff2456 security: pin CI actions to commit SHAs 2026-02-20 03:16:53 -08:00
user
f310001d1e add CI workflow for make check 2026-02-20 03:16:53 -08:00
user
950dd50c2e add make check target 2026-02-20 03:16:53 -08:00
3 changed files with 25 additions and 4 deletions

View File

@ -0,0 +1,13 @@
name: check
on:
push:
branches: [main, next]
pull_request:
branches: [main, next]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13894f8d5 # v4
- name: Build Docker image (runs make check internally)
run: docker build .

View File

@ -17,6 +17,7 @@ ARG DRONE_COMMIT_SHA unknown
RUN mkdir -p "$(go env GOMODCACHE)" && cd "$(go env GOMODCACHE)" && \
zstdmt -d --stdout /build/modcache.tzst | tar xf - && \
rm /build/modcache.tzst && cd /build
RUN make check
RUN \
cd mfer && go generate . && cd .. && \
GOPACKAGESDEBUG=true golangci-lint run ./... && \

View File

@ -13,7 +13,7 @@ GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Gitrev=$(GITREV_BUILD)
GOFLAGS := -ldflags "$(GOLDFLAGS)"
.PHONY: docker default run ci test fixme
.PHONY: docker default run ci test fixme check check-fmt lint
default: fmt test
@ -51,9 +51,8 @@ fmt: mfer/mf.pb.go
-prettier -w *.json
-prettier -w *.md
lint:
golangci-lint run
sh -c 'test -z "$$(gofmt -l .)"'
lint: mfer/mf.pb.go
golangci-lint run ./...
docker: sneak-mfer.$(ARCH).tzst.dockerimage
@ -79,3 +78,11 @@ modcache.tzst: go.mod go.sum
go mod download -x
cd $(shell go env GOMODCACHE) && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
mv $@.tmp $@
# Individual check targets
check-fmt:
@echo "==> Checking formatting..."
@test -z "$$(gofmt -l .)" || (echo "Files not formatted:" && gofmt -l . && exit 1)
# Run all checks (formatting, linting, tests) without modifying files
check: check-fmt lint test