# Tests the hub (against a real Postgres: embedded, downloaded by the tests and cached) and builds it. name: CI on: push: branches: [main] pull_request: workflow_dispatch: jobs: test: runs-on: ubuntu-latest env: GOPRIVATE: git.t5de.dev T5DE_PG_CACHE: /tmp/t5de-hub-postgres steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Cache Postgres for the tests uses: actions/cache@v4 with: path: /tmp/t5de-hub-postgres key: embedded-postgres-${{ runner.os }}-${{ hashFiles('go.sum') }} - name: Test run: | unformatted=$(gofmt -l .) if [ -n "$unformatted" ]; then echo "Not gofmt-formatted: $unformatted"; exit 1; fi go vet ./... go test ./... - name: Build run: CGO_ENABLED=0 go build -trimpath -o dist/t5de-hub ./cmd/t5de-hub