Fix/stale delivery reclaim #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| jobs: | |
| go: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Module graph | |
| run: go mod download && go mod verify | |
| - name: Vet | |
| run: go vet ./... | |
| # Integration tests are gated on CRDB_DSN and skip silently without it. Start the | |
| # same pinned dependencies used for local development so they actually run in CI. | |
| - name: Start CockroachDB and Redis | |
| run: docker compose up -d --wait --wait-timeout 120 | |
| - name: Apply schema | |
| run: make migrate | |
| - name: Test | |
| env: | |
| CRDB_DSN: postgresql://root@127.0.0.1:26257/defaultdb?sslmode=disable | |
| REDIS_ADDR: 127.0.0.1:6379 | |
| run: | | |
| set -o pipefail | |
| go test ./... -count=1 -v 2>&1 | tee /tmp/test.log | |
| # A skipped integration test looks identical to a passing one in a green build. | |
| # That is how TestIntegration_SubmitDelayedTask stayed broken unnoticed, so treat | |
| # any skip as a failure: with the dependencies up, nothing has a reason to skip. | |
| - name: Fail if any test skipped | |
| run: | | |
| if grep -Eq '^[[:space:]]*--- SKIP' /tmp/test.log; then | |
| echo "::error::Tests were skipped. Integration tests must run in CI — check CRDB_DSN and dependency health." | |
| grep -E '^[[:space:]]*--- SKIP' -A 1 /tmp/test.log | |
| exit 1 | |
| fi | |
| echo "No skipped tests." | |
| - name: Build | |
| run: go build -o /dev/null ./cmd/... | |
| - name: Dependency logs | |
| if: failure() | |
| run: docker compose logs --no-color --tail=200 |