on: [push, pull_request]
name: Cargo Flutter
jobs:
ci:
strategy:
fail-fast: false
matrix:
toolchain:
- rust: stable
- rust: nightly
platform:
- target: x86_64-unknown-linux-gnu
host: ubuntu-latest
- target: x86_64-apple-darwin
host: macos-latest
- target: x86_64-pc-windows-msvc
host: windows-latest
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
runs-on: ${{ matrix.platform.host }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache cargo folder
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ matrix.platform.target }}-cargo-${{ matrix.toolchain.rust }}
- name: Install rust toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.toolchain.rust }}
- name: Build
run: cargo build
- name: Test
run: cargo test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install rust toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
components: clippy, rustfmt
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy -- -D warnings