name: CI
on: [push, pull_request]
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0
REDIS_URL: "localhost:6379"
jobs:
test:
runs-on: ubuntu-latest
services:
redis:
image: redis:6
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.57
components: rustfmt, clippy
profile: minimal
default: true
- run: rustup update
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Static checks
run: |
cargo fmt -- --check
cargo clippy
- name: Cargo test
run: |
cargo run -p runcmd -- flushall
cargo test --all