Skip to content

feat(cli)!: move clap types into pace_core and introduce clap features for that #249

feat(cli)!: move clap types into pace_core and introduce clap features for that

feat(cli)!: move clap types into pace_core and introduce clap features for that #249

Workflow file for this run

name: Continuous Integration
on:
pull_request:
paths-ignore:
- "**/*.md"
push:
branches:
- main
- "renovate/**"
paths-ignore:
- "**/*.md"
schedule:
- cron: "0 0 * * 0"
merge_group:
types: [checks_requested]
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Run Cargo Fmt
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
# Get early warning of new lints which are regularly introduced in beta channels.
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v4 # v4
- name: Install Rust ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
test:
name: Test
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
# Get early warning of new lints which are regularly introduced in beta channels.
toolchain: [stable, beta]
job:
- os: macos-latest
- os: ubuntu-latest
- os: windows-latest
steps:
- uses: actions/checkout@v4 # v4
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
- uses: actions/checkout@v4 # v4
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install Rust ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Run Cargo Test
# run: cargo test -r --all-targets --features ${{ matrix.feature }} --workspace
run: cargo test -r --all-targets --workspace
docs:
name: Build docs
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
rust: [stable]
job:
- os: macos-latest
- os: ubuntu-latest
- os: windows-latest
steps:
- uses: actions/checkout@v4 # v4
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
- uses: actions/checkout@v4 # v4
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
- name: cargo doc
run: cargo doc --no-deps --all-features --workspace --examples
env:
RUSTDOCFLAGS: --cfg docsrs
msrv:
name: Check MSRV
runs-on: ubuntu-latest
strategy:
matrix:
crate: [pace-rs, pace_core, pace_cli]
msrv: [1.74.1]
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.msrv }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.msrv }}
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Run Cargo Hack
run: cargo hack check --rust-version -p ${{ matrix.crate }}
powerset:
# cargo-hack checks combinations of feature flags to ensure that features are all additive
# which is required for feature unification
runs-on: ubuntu-latest
name: ubuntu / stable / features
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
# intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
# --feature-powerset runs for every combination of features
- name: cargo hack
run: cargo hack --feature-powerset check
result:
name: Result (CI)
runs-on: ubuntu-latest
needs:
- fmt
- clippy
- test
- docs
- msrv
- powerset
steps:
- name: Mark the job as successful
run: exit 0
if: success()
- name: Mark the job as unsuccessful
run: exit 1
if: "!success()"