Skip to content

ci: add workflow "Release" #6

ci: add workflow "Release"

ci: add workflow "Release" #6

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- ".gitignore"
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- "**.md"
- ".gitignore"
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
# support macOS 10.7 (Lion) and later
MACOSX_DEPLOYMENT_TARGET: 10.7
jobs:
format:
name: Format [Rustfmt]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rustfmt
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run format
run: cargo fmt --all -- --check
lint:
name: Lint [Clippy]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Clippy
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run lint
run: cargo clippy
# Ensure that the project could be successfully compiled
cargo_check:
name: Compile
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [1.75.0]
needs: [format, lint]
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchains
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run cargo check
run: cargo check --workspace --locked
# Run tests
test:
name: Test
timeout-minutes: 10
needs: [cargo_check]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [1.75.0]
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchains
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --verbose