chore: Make cargo check happy (#95) #33
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- staging | |
- trying | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
build_and_test: | |
name: Build and test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
rust: [nightly, beta, stable] | |
steps: | |
- uses: actions/checkout@master | |
- name: Install ${{ matrix.rust }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }} | |
- name: Cache cargo index | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/git | |
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }} | |
- name: Cache cargo build | |
uses: actions/cache@v2 | |
with: | |
path: target | |
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Ceph | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https | |
wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add - | |
echo "deb https://download.ceph.com/debian-octopus/ focal main" | sudo tee /etc/apt/sources.list.d/ceph.list | |
sudo apt-get update -y | |
sudo apt-get install -y --no-install-recommends uuid-runtime ceph-mgr ceph-mon ceph-osd ceph-mds librados-dev libradosstriper-dev | |
- name: check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all --bins --tests | |
- name: check rados_striper | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --features rados_striper --all --bins --examples --tests | |
- name: check bench | |
uses: actions-rs/cargo@v1 | |
if: matrix.rust == 'nightly' | |
with: | |
command: check | |
args: --benches | |
- name: tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all | |
cross: | |
name: Cross compile | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- i686-unknown-linux-gnu | |
- armv7-unknown-linux-gnueabihf | |
- aarch64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@master | |
- name: Install nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: Install cross | |
run: cargo install cross | |
- name: check | |
run: cross check --all --target ${{ matrix.target }} | |
check_fmt_and_docs: | |
name: Checking fmt and docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- name: setup | |
run: | | |
rustup component add rustfmt | |
rustc --version | |
- name: fmt | |
run: cargo fmt --all -- --check |