Skip to content

Commit 34c5fd3

Browse files
committed
dev: Refactor CI and other stuff
.github/workflows/ci.yml: .gitignore: AGENTS.md: Justfile: Makefile: crates/codetracer-python-recorder/Cargo.lock: flake.nix: pyproject.toml: src/codetracer_pure_python_recorder/__init__.py: src/codetracer_pure_python_recorder/cli.py: Signed-off-by: Tzanko Matev <[email protected]>
1 parent ef3ffe5 commit 34c5fd3

File tree

10 files changed

+381
-11
lines changed

10 files changed

+381
-11
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ jobs:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Install make on Windows
19-
if: runner.os == 'Windows'
20-
run: choco install make -y
2118
- uses: actions/setup-python@v5
2219
with:
2320
python-version: '3.x'
2421
- name: Run tests
2522
shell: bash
26-
run: make test
23+
run: python -m unittest discover -v
2724

2825
nix-tests:
2926
runs-on: ubuntu-latest
@@ -35,4 +32,24 @@ jobs:
3532
extra_nix_config: |
3633
experimental-features = nix-command flakes
3734
- name: Run tests via Nix
38-
run: nix develop --command make test
35+
run: nix develop --command just test
36+
37+
rust-smoke:
38+
name: Rust module smoke test on ${{ matrix.os }}
39+
runs-on: ${{ matrix.os }}
40+
strategy:
41+
matrix:
42+
os: [ubuntu-latest, macos-latest, windows-latest]
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.x'
48+
- uses: messense/maturin-action@v1
49+
with:
50+
command: build
51+
args: -m crates/codetracer-python-recorder/Cargo.toml --release
52+
- name: Install built wheel
53+
run: python -m pip install --upgrade pip && python -m pip install target/wheels/*.whl
54+
- name: Import smoke test
55+
run: python -c "import codetracer_python_recorder as m; print(m.hello())"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.direnv/
22
**/__pycache__/
33
.aider*
4+
.venv/
5+
**/target/

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ This repository contains two related projects:
88
To run the Python test suite for the pure-Python tracer, execute:
99

1010
```
11-
make test
11+
just test
1212
```
1313

1414
The tester executes a number of sample programs in `tests/programs` and compares their outputs to the fixtures in `tests/fixtures`.
1515

1616
To build and locally develop-install the Rust-backed module:
1717

1818
```
19+
just build-rust
20+
# or:
1921
maturin develop -m crates/codetracer-python-recorder/Cargo.toml
2022
```
2123

Justfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Development helpers for the monorepo
2+
3+
# Print toolchain versions to verify the dev environment
4+
env:
5+
python3 --version
6+
cargo --version
7+
rustc --version
8+
maturin --version
9+
10+
# Create a local virtualenv for Python tooling
11+
venv:
12+
test -d .venv || python3 -m venv .venv
13+
.venv/bin/python -m pip install -U pip
14+
15+
# Build and develop-install the Rust-backed Python module
16+
build-rust:
17+
test -d .venv || python3 -m venv .venv
18+
VIRTUAL_ENV=.venv maturin develop -m crates/codetracer-python-recorder/Cargo.toml
19+
20+
# Smoke test the Rust module after build
21+
smoke-rust:
22+
.venv/bin/python -c "import codetracer_python_recorder as m; print(m.hello())"
23+
24+
# Run the Python test suite for the pure-Python recorder
25+
test:
26+
python3 -m unittest discover -v

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
# This Makefile is deprecated. Use 'just test' instead.
12
.PHONY: test
2-
33
test:
4-
python3 -m unittest discover -v
4+
@echo "Deprecated: Use 'just test' instead." && false

crates/codetracer-python-recorder/Cargo.lock

Lines changed: 295 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)