Skip to content

Rust CI

Rust CI #62

Workflow file for this run

name: Rust CI
on:
push:
branches: master
pull_request:
branches: master
schedule:
- cron: "0 0 1 * *" # monthly
workflow_dispatch: # allow manual triggering of the action
env:
RUSTFLAGS: "-Dwarnings"
jobs:
build-crate:
name: Build and test crate/docs
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
toolchain: [nightly, beta, stable]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rust-docs
- name: Build library
run: cargo build -v --lib --no-default-features
- name: Build binary
run: cargo build -v --bins
- name: Test library (palette feature)
run: cargo test --no-default-features --lib --features palette_color
- name: Doc tests (palette feature)
run: cargo test --no-default-features --doc --features palette_color
- name: Build docs
run: cargo doc --no-deps --no-default-features --features palette_color
clippy-rustfmt:
name: Clippy and rustfmt
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: clippy
run: cargo clippy
continue-on-error: true
- name: rustfmt
run: cargo fmt -- --check
continue-on-error: true