Bring the repo up to the standard layout (closes #1)
check / check (push) Successful in 5m6s
check / check (push) Successful in 5m6s
Vendors .gitignore, .dockerignore, .editorconfig, REPO_POLICIES.md, script/cibuild, script/docker, script/lint, script/test and the CI workflow byte-identical from sneak/prompts commit cc440118c876; the two ignore files then add this repo's own build output, root-anchored so cmd/bsdaily/ stays in. The Dockerfile gains a lint phase on the golangci-lint image already pinned and a test phase on the Debian Go image with sqlite3 and zstd; the build stage copies a file from each, so a plain docker build cannot skip them. Nothing installs golangci-lint on the host. On apt, script/bootstrap refreshes the package lists once before its first install. .golangci.yml and the lint cleanup: #6 Model: opus-5-5
This commit was merged in pull request #9.
This commit is contained in:
+14
-9
@@ -1,18 +1,23 @@
|
||||
#!/bin/sh
|
||||
# script/test: run the test suite. Quiet on success; on failure, rerun
|
||||
# verbosely for full diagnostic output (the exit 1 ensures the rerun
|
||||
# never turns a failure into a pass).
|
||||
# script/test: run the test suite. Testing is a phase of the Dockerfile
|
||||
# and this builds that phase alone, on the same terms as script/lint:
|
||||
# --target because a phase that is not the last stage is built only when
|
||||
# named, --no-cache because a cached test layer is a test that did not
|
||||
# run, and a tag so each build replaces the previous image.
|
||||
set -eu
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
go test -race -timeout 30s ./... || {
|
||||
echo "--- Rerunning with -v for details ---"
|
||||
go test -race -timeout 30s -v ./...
|
||||
exit 1
|
||||
}
|
||||
# The tag gets its own line: a failing command substitution inside
|
||||
# an argument does not trip `set -e`, so the inline form degrades
|
||||
# silently to an empty constant.
|
||||
tag="$("$SCRIPT_DIR/projectname")"
|
||||
docker build --no-cache \
|
||||
--target test \
|
||||
-t "$tag-test" .
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user