Skip to content

Setup CI pipeline

Setup CI pipeline #1

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
merge_group:
release:
types: [ published ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.79.0
RUST_VERSION_FMT: nightly-2024-02-07
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
jobs:
cargo:
runs-on: buildjet-4vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix:
include:
- command: clippy
args: --all-targets --all-features -- -D warnings -D clippy::dbg_macro
- command: check
args: --all-targets
- command: test
args: --all-targets --all-features
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
components: "clippy"
- run: cargo ${{ matrix.command }} ${{ matrix.args }}
rustfmt:
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION_FMT }}
components: rustfmt
- name: Rustfmt check
run: cargo +${{ env.RUST_VERSION_FMT }} fmt --all -- --check
cargo-toml-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: setup binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install Cargo.toml linter
run: cargo binstall --no-confirm cargo-sort
- name: Run Cargo.toml sort check
run: cargo sort -w --check
verifications-complete:
needs:
- rustfmt
- cargo
- cargo-toml-fmt-check
runs-on: ubuntu-latest
steps:
- run: true