[CI] Add lint workflow running pre-commit#16275
[CI] Add lint workflow running pre-commit#16275straight-shoota merged 5 commits intocrystal-lang:masterfrom
pre-commit#16275Conversation
|
Nix and devenv may be nice, but they're painfully slow to setup:
That's over 90% of the runtime spent on setup alone, repeated on every CI run 😱 (Aside: I replace the nix setup with homebrew to shove multiple minutes of setup time when I want to test something on macOS CI). |
|
Yes, the setup overhead is significant. That's unfortunate. But it's also not too bad. It might be possible to speed that up with some optimizations. Also the total duration is not that different compared to running each check in a separate job. But the best value from The current configuration already contains twice as many as tests as we have currently configured in custom workflows. And I'm planning to add more. The main benefit of this setup is to avoid the complexity of managing individual CI jobs for different tests and ensuring consistency between local use and CI. |
Are you sure? We could use some cache, but nix/devenv quickly installs gigabytes, and "devenv shell" always tries to update and to install more... |
This is a follow-up to #16263 which introduced a
pre-commitconfiguration based ondevenv.It adds a new Lint workflow which runs
pre-commitin CI. It uses differential testing that only tests files that have changes compared to the base ref of a PR, ormaster.Workflow dispatch allows running
pre-commitagainst all files in the repo.We already have a couple of individual CI job that run some of these linter:
lint-actionlint,lint-shellcheck,lint_spellcheck. The new setup replaced them. But I'm keeping them around for a while to ensure the new workflow functions properly.