Skip to content

Prepare release (#30) #70

Prepare release (#30)

Prepare release (#30) #70

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Cancel any currently running workflows from the same PR, branch, or
# tag when a new workflow is triggered.
#
# https://stackoverflow.com/a/66336834
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
jobs:
# --------------------------------------------------------------------------
# Check
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["1.67.0", stable]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: check (no_std)
run: cargo check --no-default-features
- name: check (std)
run: cargo check
# --------------------------------------------------------------------------
# Test
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: test
run: cargo test
# --------------------------------------------------------------------------
# Lint
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: clippy
run: cargo clippy -- -D warnings
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --all -- --check