Skip to content

Commit d77c630

Browse files
committed
Add CI check for UI builds
1 parent a8c54d6 commit d77c630

4 files changed

Lines changed: 42 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,31 @@ jobs:
4949
files: ./coverage.xml
5050
token: ${{ secrets.CODECOV_TOKEN }}
5151

52-
deploy-ui:
52+
ui-build:
53+
name: Build Astro UI
54+
if: github.event_name == 'pull_request'
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v7
59+
- name: Set up Python
60+
uses: actions/setup-python@v6
61+
with:
62+
python-version: '3.14'
63+
- name: Set up Node.js
64+
uses: actions/setup-node@v6
65+
with:
66+
node-version: 24
67+
cache: 'npm'
68+
cache-dependency-path: ui/package-lock.json
69+
- name: Install dependencies
70+
run: npm ci
71+
working-directory: ui
72+
- name: Build site
73+
run: npm run build
74+
working-directory: ui
75+
76+
ui-deploy:
5377
name: Deploy Astro UI
5478
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
5579
needs: python-build

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,15 @@
3535

3636
- `runner.py` — discovery and execution (pkgutil.walk_packages + `main` lookups)
3737
- `pyproject.toml` — formatting, linting, coverage rules
38+
39+
## Category Charter
40+
41+
Helpful guidance on where to place new Python module lessons:
42+
43+
- `fundamentals/`: Core syntax and structural constructs of the language (variables, expressions, strings, lists, loops, functions, basic comprehensions).
44+
- `oop/`: Object-Oriented Programming concepts (classes, inheritance, encapsulation, abstract base classes, exception handling, custom iterators, mixins, MRO).
45+
- `stdlib/`: Python standard library modules (file handling, regular expressions, json/csv formats, date/time manipulation).
46+
- `advanced/`: Metaprogramming and advanced runtime behaviors (decorators, context managers, metaclasses, weak references, walrus operator, pattern matching).
47+
- `concurrency/`: Multitasking and non-blocking models (threading, async/await, multiprocessing, subinterpreters).
48+
- `engineering/`: Code quality, benchmarking, algorithm utilities, and data structures (mocking, benchmarking, deque, namedtuple, defaultdict, itertools, heaps).
49+

ui/parse_lessons.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def get_sort_key(filename, order_list=order_list):
155155
with open(output_file, "w", encoding="utf-8") as f:
156156
json.dump(lessons, f, indent=2, ensure_ascii=False)
157157

158+
categories_file = os.path.join(output_dir, "categories.json")
159+
with open(categories_file, "w", encoding="utf-8") as f:
160+
json.dump(CATEGORY_ORDER, f, indent=2, ensure_ascii=False)
161+
158162
print(f"Successfully parsed {len(lessons)} lessons and saved to {output_file}")
159163

160164

ui/src/components/Sidebar.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import lessons from '../data/lessons.json';
3+
import categoryOrder from '../data/categories.json';
34
import { languages, useTranslations, type ui } from '../i18n/ui';
45
import { ChevronLeft, ChevronRight } from '@lucide/astro';
56
@@ -27,8 +28,6 @@ const categoriesMap = lessons.reduce((acc, lesson) => {
2728
acc[cat].lessons.push(lesson);
2829
return acc;
2930
}, {} as Record<string, { name: string; lessons: typeof lessons }>);
30-
31-
const categoryOrder = ["fundamentals", "oop", "stdlib", "advanced", "concurrency", "engineering"];
3231
---
3332

3433
<aside class="sidebar">

0 commit comments

Comments
 (0)