clap/.github/workflows/ci.yml

182 lines
4.6 KiB
YAML
Raw Normal View History

2020-04-20 21:16:33 +00:00
name: CI
on:
2021-11-17 19:55:28 +00:00
pull_request:
paths:
- '**'
- '!/*.md'
- '!/docs/**'
- "!/LICENSE-*"
2020-04-20 21:16:33 +00:00
push:
2021-11-17 19:55:28 +00:00
branches:
- master
paths:
- '**'
- '!/*.md'
- '!/docs/**'
- "!/LICENSE-*"
schedule:
- cron: '3 3 3 * *'
2020-04-20 21:16:33 +00:00
jobs:
ci:
name: CI
2021-11-17 19:55:28 +00:00
needs: [smoke, test, check, docs, rustfmt, clippy]
runs-on: ubuntu-latest
steps:
- name: Done
run: exit 0
2021-11-17 19:55:28 +00:00
smoke:
name: Quick Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Default features
run: make check-default
2020-04-20 21:16:33 +00:00
test:
2021-11-17 19:55:28 +00:00
name: Test
needs: smoke
strategy:
matrix:
build: [linux, windows, mac, minimal, default]
include:
- build: linux
os: ubuntu-latest
rust: "stable"
features: "full"
- build: windows
os: windows-latest
rust: "stable"
features: "full"
- build: mac
os: macos-latest
rust: "stable"
features: "full"
- build: minimal
os: ubuntu-latest
rust: "stable"
features: "minimal"
- build: default
os: ubuntu-latest
rust: "stable"
features: "default"
continue-on-error: ${{ matrix.rust != 'stable' }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Build
run: make build-${{matrix.features}}
- name: Test
run: make test-${{matrix.features}}
check:
name: Check
needs: smoke
runs-on: ubuntu-latest
2020-04-20 21:16:33 +00:00
strategy:
fail-fast: false
matrix:
2021-11-17 19:55:28 +00:00
build: [msrv, wasm, wasm-wasi, debug, release]
include:
- build: msrv
rust: 1.54.0 # MSRV
target: x86_64-unknown-linux-gnu
features: full
- build: wasm
rust: stable
target: wasm32-unknown-unknown
features: wasm
- build: wasm-wasi
rust: stable
target: wasm32-wasi
features: wasm
- build: debug
2020-11-28 00:50:18 +00:00
rust: stable
target: x86_64-unknown-linux-gnu
2021-11-17 19:55:28 +00:00
features: debug
- build: release
rust: stable
2020-04-20 21:16:33 +00:00
target: x86_64-unknown-linux-gnu
2021-11-17 19:55:28 +00:00
features: release
2020-04-20 21:16:33 +00:00
steps:
2021-11-17 19:55:28 +00:00
- name: Checkout repository
uses: actions/checkout@v2
2020-04-20 21:16:33 +00:00
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
2021-11-17 19:55:28 +00:00
- uses: Swatinem/rust-cache@v1
2020-11-06 18:02:43 +00:00
- name: Checkout
uses: actions/checkout@v2
2021-11-17 19:55:28 +00:00
- name: Check
run: make check-${{ matrix.features }}
docs:
name: Docs
needs: smoke
2020-11-06 18:02:43 +00:00
runs-on: ubuntu-latest
steps:
2021-11-17 19:55:28 +00:00
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --workspace --all-features --no-deps --document-private-items
rustfmt:
name: rustfmt
2020-11-06 18:02:43 +00:00
runs-on: ubuntu-latest
steps:
2021-11-17 19:55:28 +00:00
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
# Not MSRV because its harder to jump between versions and people are
# more likely to have stable
toolchain: stable
profile: minimal
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0 # MSRV
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --all-targets -- -D warnings