name: ci
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: clippy, rustfmt
- name: Build | Clippy
run: cargo clippy -- -D warnings
- name: Build | Format
run: cargo fmt -- --check
check:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-check-${{ hashFiles('Cargo.lock') }}
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build | Check
run: cargo check --all
test:
needs: check strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
binPath: target/debug/trunk
- os: macos-latest
binPath: target/debug/trunk
- os: windows-latest
binPath: target/debug/trunk.exe
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Cache Cargo
if: matrix.os != 'macos-latest'
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Setup | Cache Examples
uses: actions/cache@v2
with:
path: examples/yew/target
key: wasm32-example-yew-debug-${{ hashFiles('examples/yew/Cargo.lock') }}
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: wasm32-unknown-unknown
- name: Build | Test
run: cargo test
- name: Build | Run
run: cargo run -- -h