name: CI
on:
push:
branches:
- main
env:
RUST_VERSION_STABLE: 1.80.1
CRATE_PATHS: .
jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
components: rustfmt, clippy
override: true
- name: Checking
run: cargo c
- name: Testing
run: cargo t
- name: Clippy
run: cargo clippy --fix --all-targets -- -D warnings $(cat lint | cut -f1 -d"#" | tr '\n' ' ')
- name: Formatting
run: cargo fmt
lint-rust:
runs-on: ubuntu-latest
needs: testing
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
components: rustfmt, clippy
override: true
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings $(cat lint | cut -f1 -d"#" | tr '\n' ' ')
- name: Run rustfmt
run: cargo fmt -- --check
publish:
runs-on: ubuntu-latest
needs: lint-rust
environment: Publish
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
override: true
- name: Building
run: cargo build --release --all-targets
- name: Publishing
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: cargo publish -vv --all-features