Skip to content

Commit 4f1131e

Browse files
Add lite CI workflow for automated testing
1 parent d4d8f9d commit 4f1131e

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PICA Automation CI
2+
3+
# Trigger on push to main or pull requests
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# 1. Check out your code
19+
- uses: actions/checkout@v4
20+
21+
# 2. Set up Python 3.10 (Matches your local environment)
22+
- name: Set up Python 3.10
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.10"
26+
27+
# 3. Install System Dependencies (Required for Tkinter/Matplotlib on Linux)
28+
- name: Install Tkinter System Libs
29+
run: sudo apt-get update && sudo apt-get install -y python3-tk
30+
31+
# 4. Install Your Python Dependencies
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install pytest flake8 pytest-cov
36+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
37+
# Install the package itself in editable mode
38+
pip install -e .
39+
40+
# 5. Lint with Flake8 (The "Lite" Check)
41+
# This finds syntax errors and undefined names without running code
42+
- name: Lint with flake8
43+
run: |
44+
# Stop the build if there are Python syntax errors or undefined names
45+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
46+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
47+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
48+
49+
# 6. Run Tests (The "Logic" Check)
50+
# We ignore the visual GUI rendering tests if they are too heavy,
51+
# but since we mocked them, they should run fast!
52+
- name: Test with pytest
53+
run: |
54+
python -m pytest tests/

0 commit comments

Comments
 (0)