shell-quote CI #132
This file contains 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
name: shell-quote CI | |
on: | |
push: | |
schedule: | |
- cron: "0 0 * * 0" # weekly | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
# Make sure we have all the target shells installed. | |
- run: sudo apt-get install -y bash dash fish zsh | |
# Record shell versions. Almost unbelievably, it's not possible to get the | |
# version of Dash from `dash` itself, so we skip it here. Since `sh` might | |
# be `dash`, we also do not try to get its version. | |
- name: Shell versions | |
run: | | |
for shell in sh dash; do | |
for path in $(type -ap "$shell"); do | |
printf "%10s @ %-30q\n" "$shell" "$path" | |
done | |
done | |
for shell in bash fish zsh; do | |
for path in $(type -ap "$shell"); do | |
read -r version < <($path --version) | |
printf "%10s @ %-30q: %s\n" "$shell" "$path" "$version" | |
done | |
done | |
# Test in debug mode first. | |
- run: cargo test | |
# Test in release mode too, to defend against, for example, use of | |
# `debug_assert!` with side effects, i.e. those side effects won't happen | |
# when compiled with `--release`. | |
- run: cargo test --release | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy # i.e. `cargo check` plus extra linting. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- run: cargo clippy --all-targets -- -D warnings |