sonic-channel/.github/workflows/ci.yml

108 lines
2.4 KiB
YAML
Raw Normal View History

2022-07-21 13:23:14 +03:00
name: CI
2022-07-21 09:47:27 +03:00
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
2022-07-21 13:23:14 +03:00
tests:
2022-07-21 09:47:27 +03:00
strategy:
2022-07-21 13:23:14 +03:00
fail-fast: false
2022-07-21 09:47:27 +03:00
matrix:
os: ["ubuntu-latest"]
rust:
- stable
- beta
- nightly
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
2022-07-21 11:03:27 +03:00
- name: Restore cargo cache
uses: actions/cache@v2.1.7
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
2022-07-21 18:14:47 +03:00
- uses: isbang/compose-action@v1.1.0
2022-07-21 09:55:38 +03:00
with:
compose-file: ./docker-compose.test.yml
down-flags: --volumes
2022-07-21 09:47:27 +03:00
- name: Run tests
2022-07-21 09:51:49 +03:00
uses: actions-rs/cargo@v1
2022-07-21 09:47:27 +03:00
with:
command: test
2022-07-21 09:51:49 +03:00
args: --all-features --verbose
2022-07-21 09:47:27 +03:00
2022-07-21 10:04:29 +03:00
clippy:
name: clippy (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-07-21 11:03:27 +03:00
- name: Toolchain
2022-07-21 10:04:29 +03:00
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
2022-07-21 18:09:58 +03:00
- name: Restore cargo cache
uses: actions/cache@v2.1.7
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('Cargo.lock') }}
2022-07-21 10:04:29 +03:00
- name: Check clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
fmt:
name: fmt (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2022-07-21 11:03:27 +03:00
- name: Toolchain
2022-07-21 10:04:29 +03:00
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
2022-07-21 11:03:27 +03:00
- name: Restore cargo cache
uses: actions/cache@v2.1.7
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('Cargo.lock') }}
2022-07-21 10:04:29 +03:00
- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check