2020-04-20 21:16:33 +00:00
|
|
|
name: CI
|
2023-03-29 19:33:22 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-04-20 21:16:33 +00:00
|
|
|
on:
|
2021-11-17 19:55:28 +00:00
|
|
|
pull_request:
|
2020-04-20 21:16:33 +00:00
|
|
|
push:
|
2023-03-29 19:33:22 +00:00
|
|
|
branches:
|
2023-03-30 06:22:54 +00:00
|
|
|
- "*master"
|
2023-03-29 19:33:22 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
CLICOLOR: 1
|
2022-04-15 14:51:52 +00:00
|
|
|
|
2024-01-18 15:22:25 +00:00
|
|
|
concurrency:
|
|
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-04-20 21:16:33 +00:00
|
|
|
jobs:
|
2020-04-21 07:44:54 +00:00
|
|
|
ci:
|
2022-04-15 14:51:52 +00:00
|
|
|
permissions:
|
|
|
|
contents: none
|
2020-04-21 07:44:54 +00:00
|
|
|
name: CI
|
2024-07-25 21:50:27 +00:00
|
|
|
needs: [test, check, lockfile, docs, rustfmt, clippy, minimal-versions, cffconvert]
|
2020-04-21 07:44:54 +00:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-01 16:36:58 +00:00
|
|
|
if: "always()"
|
2020-04-21 07:44:54 +00:00
|
|
|
steps:
|
2024-04-01 16:36:58 +00:00
|
|
|
- name: Failed
|
|
|
|
run: exit 1
|
|
|
|
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
|
2020-04-20 21:16:33 +00:00
|
|
|
test:
|
2021-11-17 19:55:28 +00:00
|
|
|
name: Test
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-02 15:15:28 +00:00
|
|
|
build: [linux, windows, mac, minimal, default, next]
|
2021-11-17 19:55:28 +00:00
|
|
|
include:
|
|
|
|
- build: linux
|
2023-12-28 20:22:16 +00:00
|
|
|
os: buildjet-8vcpu-ubuntu-2204
|
2021-11-17 19:55:28 +00:00
|
|
|
rust: "stable"
|
|
|
|
features: "full"
|
|
|
|
- build: windows
|
|
|
|
os: windows-latest
|
|
|
|
rust: "stable"
|
|
|
|
features: "full"
|
|
|
|
- build: mac
|
2024-07-25 21:50:27 +00:00
|
|
|
os: macos-latest
|
2021-11-17 19:55:28 +00:00
|
|
|
rust: "stable"
|
|
|
|
features: "full"
|
|
|
|
- build: minimal
|
2024-09-27 19:28:10 +00:00
|
|
|
os: buildjet-8vcpu-ubuntu-2204
|
2021-11-17 19:55:28 +00:00
|
|
|
rust: "stable"
|
|
|
|
features: "minimal"
|
|
|
|
- build: default
|
2024-09-27 19:28:10 +00:00
|
|
|
os: buildjet-8vcpu-ubuntu-2204
|
2021-11-17 19:55:28 +00:00
|
|
|
rust: "stable"
|
|
|
|
features: "default"
|
2022-03-02 15:15:28 +00:00
|
|
|
- build: next
|
2024-09-27 19:28:10 +00:00
|
|
|
os: buildjet-8vcpu-ubuntu-2204
|
2022-03-02 15:15:28 +00:00
|
|
|
rust: "stable"
|
|
|
|
features: "next"
|
2021-11-17 19:55:28 +00:00
|
|
|
continue-on-error: ${{ matrix.rust != 'stable' }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Install Rust
|
2023-03-29 19:33:22 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-11-17 19:55:28 +00:00
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
2022-12-01 18:13:33 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Build
|
|
|
|
run: make build-${{matrix.features}}
|
|
|
|
- name: Test
|
|
|
|
run: make test-${{matrix.features}}
|
2021-12-07 14:24:13 +00:00
|
|
|
- name: Test (benches)
|
|
|
|
run: make test-${{matrix.features}} ARGS='--workspace --benches'
|
2021-12-07 14:29:03 +00:00
|
|
|
- name: Test (ultra-minimal)
|
|
|
|
if: matrix.build == 'minimal'
|
|
|
|
run: make test-minimal ARGS='--manifest-path Cargo.toml'
|
2023-07-26 16:40:03 +00:00
|
|
|
- name: Test dynamic completions
|
|
|
|
run: cargo test -p clap_complete -F unstable-dynamic
|
2024-09-27 18:53:12 +00:00
|
|
|
shell-integration:
|
|
|
|
name: Shell Integration
|
|
|
|
runs-on: buildjet-8vcpu-ubuntu-2204
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install shells
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: sudo apt-get install -y elvish fish zsh
|
|
|
|
- name: clap_complete
|
|
|
|
run: cargo test -p clap_complete -F unstable-dynamic -F unstable-shell-tests
|
|
|
|
shell-integration-nu:
|
|
|
|
name: Nushell Integration
|
|
|
|
runs-on: buildjet-8vcpu-ubuntu-2204
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: clap_complete_nu
|
|
|
|
run: cargo test -p clap_complete_nushell -F unstable-shell-tests
|
2021-11-17 19:55:28 +00:00
|
|
|
check:
|
|
|
|
name: Check
|
|
|
|
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
|
2024-02-08 15:45:17 +00:00
|
|
|
rust: "1.74" # MSRV
|
2021-11-17 19:55:28 +00:00
|
|
|
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
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-04-20 21:16:33 +00:00
|
|
|
- name: Install rust
|
2023-03-30 06:22:54 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2020-04-20 21:16:33 +00:00
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
2023-03-30 06:22:54 +00:00
|
|
|
targets: ${{ matrix.target }}
|
2022-12-01 18:13:33 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Check
|
|
|
|
run: make check-${{ matrix.features }}
|
2022-11-28 15:26:52 +00:00
|
|
|
env:
|
|
|
|
TOOLCHAIN_TARGET: ${{ matrix.target }}
|
2021-12-02 21:57:39 +00:00
|
|
|
ui:
|
|
|
|
name: UI Tests
|
|
|
|
runs-on: ubuntu-latest
|
2022-04-26 14:01:44 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
features: [default, next]
|
2021-12-02 21:57:39 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-12-02 21:57:39 +00:00
|
|
|
- name: Install Rust
|
2023-03-29 19:33:22 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-12-02 21:57:39 +00:00
|
|
|
with:
|
2024-07-31 19:52:53 +00:00
|
|
|
toolchain: "1.80" # STABLE
|
2022-12-01 18:13:33 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2021-12-02 21:57:39 +00:00
|
|
|
- name: UI Tests
|
2022-04-26 14:01:44 +00:00
|
|
|
run: make test-ui-${{ matrix.features }}
|
2024-07-09 16:06:45 +00:00
|
|
|
minimal-versions:
|
|
|
|
name: Minimal versions
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install stable Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- name: Install nightly Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
- name: Downgrade dependencies to minimal versions
|
|
|
|
run: cargo +nightly generate-lockfile -Z minimal-versions
|
|
|
|
- name: Compile with minimal versions
|
2024-07-26 02:04:51 +00:00
|
|
|
run: cargo +stable check --workspace --all-features --locked --exclude clap_complete_nushell --exclude clap_bench
|
2023-08-07 21:16:17 +00:00
|
|
|
lockfile:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-07 21:16:17 +00:00
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: "Is lockfile updated?"
|
2024-03-28 14:53:02 +00:00
|
|
|
run: cargo update --workspace --locked
|
2021-11-17 19:55:28 +00:00
|
|
|
docs:
|
|
|
|
name: Docs
|
2020-11-06 18:02:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Checkout repository
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Install Rust
|
2023-03-29 19:33:22 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-11-17 19:55:28 +00:00
|
|
|
with:
|
2024-07-26 19:38:17 +00:00
|
|
|
toolchain: "1.80" # STABLE
|
2022-12-01 18:13:33 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Check documentation
|
|
|
|
env:
|
|
|
|
RUSTDOCFLAGS: -D warnings
|
2022-06-03 16:01:53 +00:00
|
|
|
run: make doc
|
2021-11-17 19:55:28 +00:00
|
|
|
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
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Install Rust
|
2023-03-29 19:33:22 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-11-17 19:55:28 +00:00
|
|
|
with:
|
2024-07-26 19:38:17 +00:00
|
|
|
toolchain: "1.80" # STABLE
|
2021-11-17 19:55:28 +00:00
|
|
|
components: rustfmt
|
2022-12-01 18:13:33 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Check formatting
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
|
|
name: clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-11-17 19:55:28 +00:00
|
|
|
- name: Install Rust
|
2023-03-29 19:33:22 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2021-11-17 19:55:28 +00:00
|
|
|
with:
|
2024-07-26 19:38:17 +00:00
|
|
|
toolchain: "1.80" # STABLE
|
2021-11-17 19:55:28 +00:00
|
|
|
components: clippy
|
2022-12-01 18:13:33 +00:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2021-12-08 03:18:35 +00:00
|
|
|
- name: Lint (ultra-minimal)
|
|
|
|
run: make clippy-minimal ARGS='--manifest-path Cargo.toml'
|
|
|
|
- name: Lint (minimal)
|
|
|
|
run: make clippy-minimal
|
|
|
|
- name: Lint (all)
|
2021-12-09 02:18:06 +00:00
|
|
|
run: make clippy-full
|
2021-12-13 15:28:42 +00:00
|
|
|
- name: Lint (release)
|
|
|
|
run: make clippy-release
|
2023-03-09 15:55:30 +00:00
|
|
|
cffconvert:
|
|
|
|
name: cffconvert
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-01 01:38:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-03-09 15:55:30 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
- name: CFF validation
|
|
|
|
uses: citation-file-format/cffconvert-github-action@2.0.0
|
|
|
|
with:
|
|
|
|
args: --validate
|