Pyconv local sucessful #70
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run PICA JOSS Tests | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ------------------------------------------------------------------------ | |
| # PHASE 1: SETUP | |
| # ------------------------------------------------------------------------ | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install PICA in editable mode | |
| pip install -e . | |
| # Install Testing, Linting, and Coverage tools | |
| pip install pytest flake8 pytest-cov | |
| # ------------------------------------------------------------------------ | |
| # PHASE 2: READYMADE TESTS (Standard Industry Checks) | |
| # ------------------------------------------------------------------------ | |
| - name: Run Style & Syntax Check (Flake8) | |
| run: | | |
| echo "STEP 1: Checking for critical syntax errors..." | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| echo "STEP 2: Checking for code style warnings..." | |
| flake8 . --count --exit-zero --max-complexity=18 --max-line-length=127 --statistics | |
| # ------------------------------------------------------------------------ | |
| # PHASE 3: CUSTOM TESTS (The "Three Pillars") | |
| # ------------------------------------------------------------------------ | |
| # We keep these separate so the logs are easy for humans to read | |
| - name: Run Test 1 - Auto-Discovery (Smoke Test) | |
| run: | | |
| echo "--------------------------------------" | |
| echo "GOAL: Verify all GUI modules load without crashing." | |
| python -m unittest tests/test_auto_discovery.py | |
| - name: Run Test 2 - Deep Simulation (Behavior Test) | |
| run: | | |
| echo "--------------------------------------" | |
| echo "GOAL: Verify SCPI commands and hardware protocols." | |
| python -m unittest tests/test_deep_simulation.py | |
| - name: Run Test 3 - Full Stack Simulation (Integration Test) | |
| run: | | |
| echo "--------------------------------------" | |
| echo "GOAL: Verify Launcher buttons and GUI-Backend handoff." | |
| python -m unittest tests/test_full_stack_simulation.py | |
| # ------------------------------------------------------------------------ | |
| # PHASE 4: COVERAGE & PROOF (For JOSS Reviewers) | |
| # ------------------------------------------------------------------------ | |
| - name: Generate Coverage Report | |
| run: | | |
| echo "--------------------------------------" | |
| echo "GOAL: Calculate Test Coverage %" | |
| # We run pytest to generate the XML report needed by Codecov | |
| # This re-runs the tests, but captures which lines were hit. | |
| pytest --cov=. --cov-report=xml tests/ | |
| - name: Upload Coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # Optional for public repos, but good to have | |
| files: ./coverage.xml | |
| fail_ci_if_error: false |