dylint
dylint copied to clipboard
Convert GitHub workflow tests to Rust tests
Do more with Rust tests and less with Yaml/Bash.
The point is to make more tests runnable via cargo test (not to use Rust for Rust's sake).
- [x] Prettier
- [x] Cargo sort
- [x] Format
- [ ] Format example READMEs
- [ ] Main README
- [x] Individual READMEs
- [x] Format util READMEs
- [x] Check lockfiles
- [x] Check licenses
- [x]
shellcheck: https://github.com/trailofbits/dylint/blob/7fd2c4d410eb0b7744f26c224e1eb3c23083e551/.github/workflows/ci.yml#L78 - [ ] lint.sh script: https://github.com/trailofbits/dylint/blob/7fd2c4d410eb0b7744f26c224e1eb3c23083e551/.github/workflows/ci.yml#L111
Necessist uses this approach, e.g., for checking licenses and checking lockfiles.
The new tests should probably go in ci.rs.
https://github.com/trailofbits/dylint/pull/1077 is a recent example of such a conversion. Here is a summary of its changes:
- Installation of
cargo-rdmewas moved from thelintstep to theteststep: https://github.com/trailofbits/dylint/blob/879ba2626d28beabdc6c0ff0c482c81b20a54f61/.github/workflows/ci.yml#L144 - Invocation of update_util_READMEs.sh was removed from the
lintstep. - update_util_READMEs.sh was removed altogether.
- update_util_READMEs.sh's functionality was duplicated in a test. The bulk of the logic is in a closure that is passed to
preserves_cleanliness: https://github.com/trailofbits/dylint/blob/879ba2626d28beabdc6c0ff0c482c81b20a54f61/cargo-dylint/tests/ci.rs#L125-L138