Skip to content

Commit c505243

Browse files
committed
refactor(cli): rewrite cli in rust
1 parent d5d0077 commit c505243

32 files changed

+1886
-837
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
run: uv sync --locked --all-extras --dev
6161
- name: Run Ruff Format Check
6262
run: uv run ruff format --check
63-
63+
6464
docs:
6565
runs-on: ubuntu-latest
6666
steps:
@@ -100,6 +100,62 @@ jobs:
100100
run: uv sync --locked --all-extras --dev
101101
- name: Run Unittests
102102
run: uv run pytest --ignore tests/integration .
103+
104+
# Cargo / Rust stuff
105+
cargo-fmt:
106+
name: "cargo fmt"
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@v5
110+
- name: "Install Rust toolchain"
111+
run: rustup component add rustfmt
112+
- run: cargo fmt --all --check
113+
114+
cargo-clippy:
115+
name: "cargo clippy"
116+
runs-on: ubuntu-latest
117+
steps:
118+
- uses: actions/checkout@v5
119+
- uses: Swatinem/rust-cache@v2
120+
with:
121+
save-if: ${{ github.ref == 'refs/heads/main' }}
122+
- name: "Install Rust toolchain"
123+
run: rustup component add clippy
124+
- name: "Clippy"
125+
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
126+
127+
cargo-test-linux:
128+
name: "cargo test (linux)"
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v5
132+
- uses: Swatinem/rust-cache@v2
133+
with:
134+
save-if: ${{ github.ref == 'refs/heads/main' }}
135+
- name: "Install Rust toolchain"
136+
run: rustup show
137+
- name: "Run tests"
138+
run: cargo test
139+
140+
# integration / self packaging tests
141+
package_ourself:
142+
runs-on: ubuntu-latest
143+
steps:
144+
- uses: actions/checkout@v5
145+
- name: Set up Python
146+
uses: actions/setup-python@v6
147+
with:
148+
python-version: "3.12"
149+
- name: Install uv
150+
uses: astral-sh/setup-uv@v6
151+
with:
152+
enable-cache: true
153+
- name: Install the project
154+
run: uv sync --locked --all-extras --dev
155+
- name: Install debmagic (cli)
156+
run: uv pip install packages/debmagic
157+
- name: Run Debmagic build on ourself
158+
run: uv run debmagic build --driver=docker
103159

104160
# TODO: integration tests currently don't work in the CI since they require running apt source on debian trixie -> CI runs on ubuntu
105161
# integration-tests:
@@ -122,21 +178,4 @@ jobs:
122178
# - name: Install the project
123179
# run: uv sync --locked --all-extras --dev
124180
# - name: Run Integrationtests
125-
# run: uv run pytest tests/integration
126-
127-
package_ourself:
128-
runs-on: ubuntu-latest
129-
steps:
130-
- uses: actions/checkout@v5
131-
- name: Set up Python
132-
uses: actions/setup-python@v6
133-
with:
134-
python-version: "3.12"
135-
- name: Install uv
136-
uses: astral-sh/setup-uv@v6
137-
with:
138-
enable-cache: true
139-
- name: Install the project
140-
run: uv sync --locked --all-extras --dev
141-
- name: Run Debmagic build on ourself
142-
run: uv run debmagic build --driver=docker
181+
# run: uv run pytest tests/integration

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,8 @@ todo.md
5353
todo.org
5454

5555

56+
57+
58+
# Added by cargo
59+
60+
/target

0 commit comments

Comments
 (0)