Skip to content

Add full CI: compile, lint, specs, every database, installed use - #99

Open
crimson-knight wants to merge 4 commits into
masterfrom
ci/full-coverage
Open

crimson-knight wants to merge 4 commits into
masterfrom
ci/full-coverage

Conversation

@crimson-knight

@crimson-knight crimson-knight commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Micrate's only CI was a Travis file that no longer runs, so pull requests had no automated checks. This adds a GitHub Actions workflow.

Job What it proves
Format, compile, lint and specs crystal tool format --check, every entry point compiled with warnings as errors, amber-lsp on every source file, specs
Specs on Apple Silicon The same compile and spec checks, plus the SQLite lifecycle
Command-line lifecycle on every database The real CLI runs create, up, status, down, redo, dbversion and drop on SQLite, PostgreSQL and MySQL, checking the version after each step
Installed as a dependency Installs Micrate into a new application and runs its bin/micrate wrapper, which compiles the CLI on first run
crystal-alpha Format, compile, API card probes and specs on the compiler Amber V2 applications build with

Also in this PR

  • shard.lock is committed so CI installs hash-verified dependencies. It was previously ignored.
  • Development dependencies are pinned by commit, and the PostgreSQL, MySQL and SQLite drivers are development dependencies so CI can exercise each one.
  • .amber-lsp.yml adds three library rules: named errors, no ENV reads inside the library, and no catch-all rescue. Each states why it exists. They start as warnings because existing code breaks them, and a rule moves to error once its findings are fixed.
  • amber-lsp comes from the v2.0.10 release, verified by sha256.
  • .travis.yml is removed.

A bug the new MySQL job found on its first run: MySQL timestamps have one-second precision, so a migration rolled back in the same second it was applied still read as applied. That answer drives the status output and the out-of-order check that can stop up. Status now reads history by row id, the way dbversion already does.

Verified locally on crystal-alpha 1.21.0: clean --frozen install, format, all three entry points, API card probes (3), 11 specs, amber-lsp on all 12 source files (and a confirmed failure when a rule is set to error), the full lifecycle on SQLite and PostgreSQL, and the installed-dependency path. MySQL runs for the first time in this PR's CI.

Follow-ups outside this PR

  • The workflow does not assert the failure path yet: on master, a migration that fails exits with status 0. A fix and its assertion belong in their own change.
  • master still requires the continuous-integration/travis-ci status, which no longer reports. Replace it with these jobs once they are green.
  • Dockerfile is still on crystallang/crystal:1.0.0 by tag.

Micrate's only CI was a Travis file that no longer runs, so nothing checked
pull requests. This adds a GitHub Actions workflow that checks formatting,
compiles every entry point with warnings as errors, runs Ameba and the specs,
runs the real command-line tool through a migration lifecycle on SQLite,
PostgreSQL and MySQL, installs Micrate into a new application and runs its
bin/micrate wrapper, and repeats the compile and spec checks on Apple Silicon
and crystal-alpha.

shard.lock is now committed so CI installs hash-verified dependencies, and the
development dependencies are pinned by commit. .ameba.yml records the existing
Ameba issues per file so new code is checked from the first run.
…robes

The new MySQL job showed a migration rolled back in the same second it was
applied still reading as applied. MySQL's timestamp column has one-second
precision, so ORDER BY tstamp ties. Micrate plans its work from that status.
Rows are now read by id, which is how dbversion already reads them.

The API card probe script replaced CRYSTAL_PATH and dropped the standard
library when run with a freshly built compiler.
The status query now explains why it sorts by id, on each database. The CI
jobs and scripts say what each one proves that the others cannot.

This also corrects the previous commit's message: the migration plan selects
versions without reading the applied flag. The history row affects the status
output and the out-of-order check that can stop `up`.
amber-lsp is the Amber ecosystem's linter, so CI runs it over every source
file from a release pinned by hash, and Ameba and its baseline file are gone.

.amber-lsp.yml adds three library rules and records why each one exists. They
start as warnings because existing code breaks them; a rule moves to error once
its findings are fixed.
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