Skip to content

ci: add PR checks and harden outputs#8

Open
AdekunleBamz wants to merge 1 commit intobase:mainfrom
AdekunleBamz:ci-go-tests-and-dockerignore
Open

ci: add PR checks and harden outputs#8
AdekunleBamz wants to merge 1 commit intobase:mainfrom
AdekunleBamz:ci-go-tests-and-dockerignore

Conversation

@AdekunleBamz
Copy link

This PR improves reliability and contributor experience for transaction-latency by adding PR-time checks, tightening Docker build context, and hardening runtime behavior.

Why

  • There was no CI coverage on pull requests (only a Docker push workflow on main), so regressions could merge unnoticed.
  • Docker builds could accidentally include sensitive/local files (like .env or data outputs) in the build context.
  • The tool could fail writing CSVs if the output directory didn’t exist, and receipt polling treated all RPC errors the same.

Changes

  • Add a new CI workflow that runs on PRs and main pushes:
    • gofmt check
    • go vet ./...
    • go test ./...
    • Docker build (no push)
  • Add .dockerignore to exclude .env, data/, git metadata, etc.
  • Improve runtime robustness:
    • Validate TO_ADDRESS as a proper hex address and disallow zero address.
    • Create output directory before writing CSV.
    • Only sleep on receipt-not-found; fail fast on other receipt errors.
  • Expand README with clearer setup/run steps and output file locations.

Verification

  • Open the PR and confirm the new CI workflow runs on GitHub Actions.
  • (Optional) Build/run locally:
    • docker build -t transaction-latency .
    • docker run --rm -it -v "$(pwd)/data:/app/data" --env-file .env transaction-latency

- Add CI on PRs (gofmt/go vet/go test) and a no-push Docker build
- Add .dockerignore to avoid leaking .env/data into build context
- Improve runtime robustness (address validation, safer receipt polling, mkdir output dir)
- Expand README with setup/run/output docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant