Repository navigation
Add full CI: compile, lint, specs, every database, installed use - #99
Open
crimson-knight wants to merge 4 commits into
Open
crimson-knight wants to merge 4 commits into
crimson-knight wants to merge 4 commits into
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
crystal tool format --check, every entry point compiled with warnings as errors, amber-lsp on every source file, specscreate,up,status,down,redo,dbversionanddropon SQLite, PostgreSQL and MySQL, checking the version after each stepbin/micratewrapper, which compiles the CLI on first runAlso in this PR
shard.lockis committed so CI installs hash-verified dependencies. It was previously ignored..amber-lsp.ymladds three library rules: named errors, noENVreads inside the library, and no catch-allrescue. Each states why it exists. They start as warnings because existing code breaks them, and a rule moves toerroronce its findings are fixed..travis.ymlis 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
statusoutput and the out-of-order check that can stopup. Status now reads history by row id, the waydbversionalready does.Verified locally on crystal-alpha 1.21.0: clean
--frozeninstall, 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 toerror), 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
masterstill requires thecontinuous-integration/travis-cistatus, which no longer reports. Replace it with these jobs once they are green.Dockerfileis still oncrystallang/crystal:1.0.0by tag.