refactor(cli): rewrite cli in rust #73
Workflow file for this run
This file contains hidden or 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: CI | |
| permissions: {} | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run Ruff Lint | |
| run: uv run ruff check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run Ty for typechecking | |
| run: uv run ty check | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run Ruff Format Check | |
| run: uv run ruff format --check | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run sphinx-build | |
| run: uv run sphinx-build docs docs/_build | |
| unit-tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.12" | |
| - "3.13" | |
| os: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run Unittests | |
| run: uv run pytest --ignore tests/integration . | |
| # Cargo / Rust stuff | |
| cargo-fmt: | |
| name: "cargo fmt" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: "Install Rust toolchain" | |
| run: rustup component add rustfmt | |
| - run: cargo fmt --all --check | |
| cargo-clippy: | |
| name: "cargo clippy" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: "Install Rust toolchain" | |
| run: rustup component add clippy | |
| - name: "Clippy" | |
| run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings | |
| cargo-test-linux: | |
| name: "cargo test (linux)" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: "Install Rust toolchain" | |
| run: rustup show | |
| - name: "Run tests" | |
| run: cargo test | |
| # integration / self packaging tests | |
| package_ourself: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Install debmagic (cli) | |
| run: uv pip install packages/debmagic | |
| - name: Run Debmagic build on ourself | |
| run: uv run debmagic build --driver=docker | |
| # TODO: integration tests currently don't work in the CI since they require running apt source on debian trixie -> CI runs on ubuntu | |
| # integration-tests: | |
| # runs-on: ${{ matrix.os }} | |
| # strategy: | |
| # matrix: | |
| # python-version: | |
| # - "3.12" | |
| # os: [ubuntu-latest] | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - name: Set up Python | |
| # uses: actions/setup-python@v6 | |
| # with: | |
| # python-version: "3.12" | |
| # - name: Install uv | |
| # uses: astral-sh/setup-uv@v6 | |
| # with: | |
| # enable-cache: true | |
| # - name: Install the project | |
| # run: uv sync --locked --all-extras --dev | |
| # - name: Run Integrationtests | |
| # run: uv run pytest tests/integration |