Set up CI and git hooks for quality assurance #9

Open
opened 2026-01-28 08:51:12 +00:00 by mprihoda · 0 comments
mprihoda commented 2026-01-28 08:51:12 +00:00 (Migrated from github.com)

Summary

Set up continuous integration (GitHub Actions) and local git hooks to ensure code quality and catch issues early.

Motivation

Currently there's no automated verification that code compiles and tests pass. We need:

  • CI to verify PRs and pushes to main
  • Local hooks to catch issues before they reach the remote

Current State

  • Build system: SBT with multiple modules (JVM + JS cross-compilation)
  • CI: None configured
  • Git hooks: Only sample hooks, no active hooks

Requirements

GitHub Actions CI

Triggers:

  • Push to main
  • Pull requests to main

Jobs:

  1. Compile - Verify all modules compile

    • sbt compile (JVM)
    • sbt <js-modules>/compile (JS)
  2. Test - Run test suites

    • sbt test (unit tests)
    • Consider: integration tests (may need test containers/services)
  3. Formatting/Linting (if applicable)

    • Scalafmt check
    • Scalafix (if configured)

Considerations:

  • Cache SBT dependencies and Coursier cache
  • Matrix build if supporting multiple Scala versions
  • Separate jobs for fast feedback vs. thorough testing
  • Integration tests may need database containers

Git Hooks

Pre-commit:

  • Compile check (or at least formatting)
  • Fast feedback, shouldn't block for too long

Pre-push:

  • Run tests
  • Ensure we don't push broken code

Implementation options:

Research Questions

  1. What's the full test suite runtime? (impacts CI and hook design)
  2. Do integration tests need external services (databases, etc.)?
  3. Is Scalafmt/Scalafix already configured?
  4. Any specific Scala/JDK version requirements?

Deliverables

  1. .github/workflows/ci.yml - GitHub Actions workflow
  2. Git hooks setup (committed and documented)
  3. Documentation on local setup for contributors

Checklist

  • Research current test coverage and runtime
  • Set up basic GitHub Actions workflow (compile + test)
  • Add dependency caching to CI
  • Set up pre-commit hook
  • Set up pre-push hook
  • Document hook installation for contributors
  • Test CI on a PR
  • Add CI status badge to README (if exists)
## Summary Set up continuous integration (GitHub Actions) and local git hooks to ensure code quality and catch issues early. ## Motivation Currently there's no automated verification that code compiles and tests pass. We need: - CI to verify PRs and pushes to main - Local hooks to catch issues before they reach the remote ## Current State - **Build system:** SBT with multiple modules (JVM + JS cross-compilation) - **CI:** None configured - **Git hooks:** Only sample hooks, no active hooks ## Requirements ### GitHub Actions CI **Triggers:** - Push to `main` - Pull requests to `main` **Jobs:** 1. **Compile** - Verify all modules compile - `sbt compile` (JVM) - `sbt <js-modules>/compile` (JS) 2. **Test** - Run test suites - `sbt test` (unit tests) - Consider: integration tests (may need test containers/services) 3. **Formatting/Linting** (if applicable) - Scalafmt check - Scalafix (if configured) **Considerations:** - Cache SBT dependencies and Coursier cache - Matrix build if supporting multiple Scala versions - Separate jobs for fast feedback vs. thorough testing - Integration tests may need database containers ### Git Hooks **Pre-commit:** - Compile check (or at least formatting) - Fast feedback, shouldn't block for too long **Pre-push:** - Run tests - Ensure we don't push broken code **Implementation options:** - Simple shell scripts in `.git/hooks/` - [sbt-git-hooks](https://github.com/sbt/sbt-git-hooks) plugin - [pre-commit](https://pre-commit.com/) framework - [husky](https://typicode.github.io/husky/) (if Node.js is available) - [lefthook](https://github.com/evilmartians/lefthook) ## Research Questions 1. What's the full test suite runtime? (impacts CI and hook design) 2. Do integration tests need external services (databases, etc.)? 3. Is Scalafmt/Scalafix already configured? 4. Any specific Scala/JDK version requirements? ## Deliverables 1. `.github/workflows/ci.yml` - GitHub Actions workflow 2. Git hooks setup (committed and documented) 3. Documentation on local setup for contributors ## Checklist - [ ] Research current test coverage and runtime - [ ] Set up basic GitHub Actions workflow (compile + test) - [ ] Add dependency caching to CI - [ ] Set up pre-commit hook - [ ] Set up pre-push hook - [ ] Document hook installation for contributors - [ ] Test CI on a PR - [ ] Add CI status badge to README (if exists)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/support#9
No description provided.