name: CI
on:
push:
pull_request:
jobs:
ci:
name: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: fmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --all-targets -- -D warnings
- name: test
run: cargo test --all
- name: crate metadata is complete
run: |
for field in description repository homepage documentation readme license keywords categories rust-version; do
if ! grep -q "^${field} " Cargo.toml; then
echo "Cargo.toml [package] is missing ${field}"
exit 1
fi
done
cargo package --no-verify
- name: cargo publish --dry-run
run: cargo publish --dry-run