Skip to content

Commit c82a161

Browse files
authored
Merge pull request #14 from SFTtech/milo/rewrite-in-rust-lol
refactor(cli): rewrite cli in rust
2 parents d5d0077 + 99dd681 commit c82a161

35 files changed

+2103
-851
lines changed

.github/workflows/ci.yml

Lines changed: 61 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,65 @@ 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+
- uses: Swatinem/rust-cache@v2
154+
with:
155+
save-if: ${{ github.ref == 'refs/heads/main' }}
156+
- name: Install the project
157+
run: uv sync --locked --all-extras --dev
158+
- name: Install debmagic (cli)
159+
run: uv pip install packages/debmagic
160+
- name: Run Debmagic build on ourself
161+
run: uv run debmagic build --driver=docker
103162

104163
# TODO: integration tests currently don't work in the CI since they require running apt source on debian trixie -> CI runs on ubuntu
105164
# integration-tests:
@@ -122,21 +181,4 @@ jobs:
122181
# - name: Install the project
123182
# run: uv sync --locked --all-extras --dev
124183
# - 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
184+
# run: uv run pytest tests/integration

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ venv*
2424
MANIFEST
2525
dist/
2626
src/*/*.lock
27+
# Rust
28+
/target
2729

2830
# testing
2931
/*.conf
@@ -51,5 +53,3 @@ Thumbs.db
5153
# local
5254
todo.md
5355
todo.org
54-
55-

0 commit comments

Comments
 (0)