Lint katib example #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: main | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
# https://doc.rust-lang.org/cargo/reference/unstable.html#direct-minimal-versions | |
launch-mininal-versions: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 # If CI starts to take longer than this we should attempt to optimize before extending. | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchains | |
run: rustup --quiet toolchain install --profile minimal stable nightly --component rustfmt,clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Direct minimal versions | |
run: cargo +nightly -Zdirect-minimal-versions update | |
- name: Build | |
run: cargo build --all-targets --all-features --locked | |
- name: Test | |
run: cargo test --all-features --locked | |
launch: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 # If CI starts to take longer than this we should attempt to optimize before extending. | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchains | |
run: rustup --quiet toolchain install --profile minimal stable nightly --component rustfmt,clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Format | |
run: cargo +nightly fmt --check | |
- name: Build | |
run: cargo build --all-targets --all-features --locked | |
- name: Lint | |
run: cargo clippy --all-targets --all-features --locked -- -D warnings | |
- name: Test | |
run: cargo test --all-features --locked | |
examples: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 # If CI starts to take longer than this we should attempt to optimize before extending. | |
defaults: | |
run: | |
working-directory: examples/katib | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v3 | |
- name: ruff format | |
run: uv run -- ruff format --check | |
- name: ruff check | |
run: uv run -- ruff check | |
- name: pyright | |
run: uv run -- pyright |