48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
when:
|
|
- event: [push, pull_request]
|
|
|
|
steps:
|
|
tests:
|
|
image: golang:1.25
|
|
commands:
|
|
- go test ./...
|
|
|
|
race-tests:
|
|
image: golang:1.25
|
|
depends_on: tests
|
|
commands:
|
|
- go test -race ./...
|
|
|
|
static-analysis:
|
|
image: golang:1.25
|
|
depends_on: tests
|
|
commands:
|
|
- go vet ./...
|
|
|
|
build:
|
|
image: golang:1.25
|
|
depends_on: tests
|
|
commands:
|
|
- go build ./...
|
|
|
|
documentation-and-examples:
|
|
image: golang:1.25
|
|
depends_on: tests
|
|
commands:
|
|
- go test ./internal/doccheck
|
|
- go test ./internal/config -run '^TestExamplesLoadAndValidate$'
|
|
|
|
cross-build:
|
|
image: golang:1.25
|
|
depends_on: [race-tests, static-analysis, build, documentation-and-examples]
|
|
commands:
|
|
- |
|
|
set -eu
|
|
output_dir="$(mktemp -d)"
|
|
trap 'rm -rf "$output_dir"' EXIT
|
|
for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64; do
|
|
goos="${target%/*}"
|
|
goarch="${target#*/}"
|
|
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build -o "$output_dir/narratio-$goos-$goarch" ./cmd/narratio
|
|
done
|