64 lines
1.4 KiB
YAML
64 lines
1.4 KiB
YAML
|
name: "Build and test"
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
pull_request:
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v3
|
||
|
|
||
|
- name: Install latest nightly toolchain
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
toolchain: nightly
|
||
|
override: true
|
||
|
components: rustfmt, clippy
|
||
|
|
||
|
- name: Cache dependencies
|
||
|
uses: Swatinem/rust-cache@v2
|
||
|
|
||
|
- name: Build
|
||
|
run: cargo build --all-features --verbose
|
||
|
|
||
|
check:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v3
|
||
|
|
||
|
- name: Install latest nightly toolchain
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
toolchain: nightly
|
||
|
override: true
|
||
|
components: rustfmt, clippy
|
||
|
|
||
|
- name: Cache dependencies
|
||
|
uses: Swatinem/rust-cache@v2
|
||
|
|
||
|
- name: Check code format
|
||
|
run: cargo fmt -- --check
|
||
|
|
||
|
- name: Check clippy
|
||
|
run: cargo clippy --all-features -- --deny warnings
|
||
|
|
||
|
test:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v3
|
||
|
|
||
|
- name: Install latest nightly toolchain
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
toolchain: nightly
|
||
|
override: true
|
||
|
components: rustfmt, clippy
|
||
|
|
||
|
- name: Cache dependencies
|
||
|
uses: Swatinem/rust-cache@v2
|
||
|
|
||
|
- name: Run tests
|
||
|
run: cargo test --all-features --verbose
|