name: ci
on: [push]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
id: toolchain
with:
override: true
profile: minimal
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ github.ref }}-${{ github.job }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.toml') }}
restore-keys: refs/heads/master-${{ github.job }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.toml') }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
id: toolchain
with:
components: rustfmt
override: true
profile: minimal
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ github.ref }}-${{ github.job }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.toml') }}
restore-keys: refs/heads/master-${{ github.job }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.toml') }}
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
id: toolchain
with:
components: clippy
override: true
profile: minimal
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ github.ref }}-${{ github.job }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.toml') }}
restore-keys: refs/heads/master-${{ github.job }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.toml') }}
- name: Lint
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings