Skip to content

Commit 5b0b82f

Browse files
Refactor CI workflows: replace Python CI and formatting workflows with unified pytest and lint workflows for improved clarity and maintainability
1 parent 6f810b1 commit 5b0b82f

5 files changed

Lines changed: 56 additions & 85 deletions

File tree

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ TechLang is a hacker-themed, stack-based programming language with its own inter
4343
- Multi-line: `assert run(code).strip().splitlines() == ["line1", "line2"]`
4444
- Tests in `tests/test_*.py` cover interpreter, database, data types, file ops, graphics, network, threads, etc.
4545
- **CI workflows**:
46-
- `.github/workflows/python-app.yml`: Runs `python run_tests.py` on push/PR to main
47-
- `.github/workflows/techlang-format.yml`: Enforces formatting/linting on all `.tl` files in `examples/`
46+
- `.github/workflows/pytest.yml`: Runs `python run_tests.py` on push/PR to main
47+
- `.github/workflows/lint.yml`: Lints Python code and enforces formatting/linting on all `.tl` files in `examples/`
4848
- **Formatter/linter**: `python format_tl.py --check file.tl` (check formatting), `--fix` (reformat in place), `--lint` (detect issues like unclosed blocks, undefined vars).
4949
- **Documentation sync**: When adding/renaming commands, update `examples/`, `docs/*.md`, and ensure CLI (`cli.py`), GUI (`playground/gui.py`), and web app (`techlang_web/app.py`) remain aligned.
5050
- **CLI modes**: `tl file.tl` (run file), `tl -i` (REPL), `tl -v file.tl` (verbose—streams each command before execution, helpful for tracing parser vs executor).
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python CI
1+
name: Lint
22

33
on:
44
push:
@@ -7,7 +7,8 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
test:
10+
lint-python:
11+
name: Lint Python Code
1112
runs-on: ubuntu-latest
1213

1314
steps:
@@ -19,18 +20,21 @@ jobs:
1920
with:
2021
python-version: "3.10"
2122

22-
- name: Install dependencies
23+
- name: Install flake8
2324
run: |
2425
python -m pip install --upgrade pip
25-
pip install -r requirements.txt
26-
pip install pytest
26+
pip install flake8
2727
28-
- name: Run tests
28+
- name: Lint Python files
2929
run: |
30-
python run_tests.py
30+
flake8 techlang/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
31+
flake8 techlang/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32+
continue-on-error: true
3133

32-
lint:
34+
lint-techlang:
35+
name: Lint TechLang Files
3336
runs-on: ubuntu-latest
37+
3438
steps:
3539
- name: Checkout repository
3640
uses: actions/checkout@v4
@@ -40,12 +44,16 @@ jobs:
4044
with:
4145
python-version: "3.10"
4246

43-
- name: Install flake8
47+
- name: Install dependencies
4448
run: |
4549
python -m pip install --upgrade pip
46-
pip install flake8
50+
pip install -r requirements.txt
51+
52+
- name: Check TechLang formatting
53+
run: |
54+
python format_tl.py --check examples/
4755
48-
- name: Lint code (optional)
56+
- name: Lint TechLang files
4957
run: |
50-
# This will show lint warnings but never fail the job
51-
flake8 . --count --max-line-length=127 --statistics --exit-zero
58+
python format_tl.py --lint examples/
59+
continue-on-error: true

.github/workflows/pytest.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
test:
11+
name: Run Python Tests
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
pip install pytest
28+
29+
- name: Run test suite
30+
run: |
31+
python run_tests.py

.github/workflows/techlang-format.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ call utils.helpers.greet # both :: and . work
353353

354354
### GitHub Actions
355355

356-
1. **`python-app.yml`**: Runs full test suite on push/PR
357-
2. **`techlang-format.yml`**: Validates `.tl` file formatting
356+
1. **`pytest.yml`**: Runs full test suite on push/PR
357+
2. **`lint.yml`**: Lints Python code and validates TechLang (`.tl`) file formatting
358358

359359
### Pre-Commit Checklist
360360

0 commit comments

Comments
 (0)