name: build
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
check:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
features: ["", "--features bincode", "--features speedy"]
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: --cfg ci_test
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
toolchain: stable
profile: minimal
components: clippy
target: i686-unknown-linux-gnu
- uses: actions-rs/toolchain@v1
if: ${{ matrix.os == 'windows-latest' }}
with:
toolchain: stable
profile: minimal
components: clippy
target: i686-pc-windows-msvc
- name: Clippy (64-bit)
run: cargo clippy --profile ci-test --examples --tests --benches ${{ matrix.features }}
- name: Clippy (32-bit)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo clippy --target i686-unknown-linux-gnu --profile ci-test --examples --tests --benches ${{ matrix.features }}
- name: Clippy (32-bit)
if: ${{ matrix.os == 'windows-latest' }}
run: cargo clippy --target i686-pc-windows-msvc --profile ci-test --examples --tests --benches ${{ matrix.features }}
fmt:
needs: check
runs-on: ubuntu-latest
env:
RUSTFLAGS: --cfg ci_test
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
test:
needs: fmt
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
features: ["", "--features bincode", "--features speedy"]
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: --cfg ci_test
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Run doctests
run: cargo test --profile ci-test ${{ matrix.features }}
test_examples:
needs: test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
features: ["", "--features bincode", "--features speedy"]
example: ["--example viaduct", "--example parallel_requests"]
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: --cfg ci_test
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Test example
run: cargo run --profile ci-test ${{ matrix.features }} ${{ matrix.example }}