Release windsock 0.2.0 (#11) #38
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: Formatting and lints | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Cancel already running jobs | |
concurrency: | |
group: lints_${{ github.head_ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
jobs: | |
job: | |
name: Formatting and lints | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
# this line means that only the main branch writes to the cache | |
# benefits: | |
# * prevents main branch caches from being evicted in favor of a PR cache | |
# * saves about 1min per workflow by skipping the actual cache write | |
# downsides: | |
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached. | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-hack@0.6.16 | |
- name: Ensure `cargo fmt --all` was run | |
run: cargo fmt --all -- --check | |
- name: Ensure that all crates compile and have no warnings under every possible combination of features | |
# some things to explicitly point out: | |
# * clippy also reports rustc warnings and errors | |
# * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default. | |
run: cargo hack --feature-powerset --at-least-one-of redis,cassandra,kafka,opensearch clippy --all-targets --locked -- -D warnings | |
- name: Ensure that tests did not create or modify any files that arent .gitignore'd | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git status | |
exit 1 | |
fi |