Skip to content

Commit d217416

Browse files
committed
fix: Fix CI
1 parent 28589a6 commit d217416

File tree

5 files changed

+378
-420
lines changed

5 files changed

+378
-420
lines changed

.github/workflows/check-code.yml

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
- "tests/**"
1111
- "pyproject.toml"
1212
- "uv.lock"
13-
- "justfile"
1413
- "nix/**"
1514
- "flake.nix"
1615
- "flake.lock"
@@ -21,47 +20,56 @@ concurrency:
2120
cancel-in-progress: true
2221

2322
jobs:
24-
build-test:
23+
check-code:
2524
# Ubicloud managed runner
2625
runs-on: ubicloud-standard-2
2726

2827
strategy:
2928
fail-fast: false
3029
matrix:
31-
python-version: ["3.10", "3.13"]
30+
python-version: ["3.10", "3.12"]
3231

3332
steps:
3433
- name: Checkout
3534
uses: actions/checkout@v4
3635

36+
- name: "Set up Python"
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
3741
- name: Setup uv (with caching)
3842
uses: astral-sh/setup-uv@v6
3943
with:
4044
enable-cache: true
4145
ignore-nothing-to-cache: true
4246

43-
- name: Install Python ${{ matrix.python-version }}
44-
run: uv python install ${{ matrix.python-version }}
45-
46-
- name: Install just
47-
run: |
48-
sudo apt-get update
49-
sudo apt-get install -y just
47+
# - name: Create venv for ${{ matrix.python-version }}
48+
# run: uv venv --python ${{ matrix.python-version }}
5049

5150
- name: Sync dependencies
52-
run: uv sync
51+
run: uv sync --python ${{ matrix.python-version }} --frozen
5352

54-
- name: Lint & Format (via just)
55-
run: just lint
53+
# Optional: prove we're using the right interpreter
54+
- name: Show Python used by uv
55+
run: uv run --python ${{ matrix.python-version }} python -V
5656

57-
- name: Typecheck (via just)
58-
run: just typecheck
57+
- name: Lint
58+
run: uv run --python ${{ matrix.python-version }} ruff check ./src
59+
60+
- name: Typecheck
61+
run: |
62+
uv run --python ${{ matrix.python-version }} basedpyright ./src
63+
64+
- name: Check formatting
65+
run: |
66+
uv run --python ${{ matrix.python-version }} ruff format --check ./src
5967
60-
- name: Test (via just)
61-
run: just test
68+
- name: Test
69+
run: uv run --python ${{ matrix.python-version }} pytest -q
6270

63-
- name: Coverage (via just)
64-
run: just cov
71+
- name: Coverage
72+
run: uv run --python ${{ matrix.python-version }} pytest --cov=torusdk --cov-report=term-missing --cov-report=xml
6573

6674
- name: Upload coverage XML
6775
uses: actions/upload-artifact@v4
@@ -71,21 +79,7 @@ jobs:
7179

7280
- name: Enforce Towncrier fragment on PRs
7381
if: ${{ github.event_name == 'pull_request' }}
74-
run: just news-check
82+
run: uv run --python ${{ matrix.python-version }} towncrier check --compare-with origin/main
7583

7684
- name: Build package
77-
run: just build
78-
79-
# Separate job for Nix-specific checks
80-
nix-checks:
81-
runs-on: ubicloud-standard-2
82-
83-
steps:
84-
- name: Checkout
85-
uses: actions/checkout@v4
86-
87-
- name: Install Nix
88-
uses: DeterminateSystems/nix-installer-action@main
89-
90-
- name: Check Nix flake
91-
run: nix flake check
85+
run: uv run --python ${{ matrix.python-version }} uv build

.github/workflows/check-nix.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ name: Nix checks
33
on:
44
pull_request:
55
push:
6-
branches: [main, dev]
6+
branches: [main, test-ci]
77

88
jobs:
9-
checks:
9+
check-nix:
1010
runs-on: ubicloud-standard-2
1111
permissions:
1212
contents: read
1313
id-token: write
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616

1717
- name: Install Nix
1818
uses: DeterminateSystems/nix-installer-action@main
19+
1920
# - uses: DeterminateSystems/magic-nix-cache-action@main
2021

2122
- name: Check health of flake.lock

justfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ update:
4545

4646
# ==== Code Quality ====
4747

48-
# Format + autofix lint where possible (developer use)
49-
fmt:
50-
uv run ruff format ./src
51-
uv run ruff check --fix ./src
52-
53-
# Check formatting without changing files (CI use)
48+
# Check formatting without changing files
5449
fmt-check:
5550
uv run ruff format --check ./src
56-
uv run ruff check ./src
51+
52+
# Format files
53+
fmt:
54+
uv run ruff format ./src
5755

5856
# Static analysis: lints + types (CI and local)
59-
lint: fmt-check
57+
lint:
6058
uv run ruff check ./src
61-
uv run basedpyright ./src
6259

63-
# Only run type checker (useful locally)
60+
# Run typechecker
6461
typecheck:
6562
uv run basedpyright ./src
6663

64+
# Run all checks
65+
check: lint typecheck fmt-check
66+
6767
# ==== Tests & Coverage ====
6868

6969
# Run tests (when they exist)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Torus official Python SDK / CLI"
55
authors = [{ name = "Renlabs", email = "[email protected]" }]
66
license = { text = "MIT" }
77
readme = "README.md"
8-
requires-python = ">=3.11"
8+
requires-python = ">=3.10,<3.13"
99
classifiers = [
1010
"Intended Audience :: Developers",
1111
"License :: OSI Approved :: MIT License",

0 commit comments

Comments
 (0)