change: changed the output file wording #14
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: Test Suite | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . | |
| python -m pip install pytest pytest-cov | |
| - name: Verify package installation | |
| run: | | |
| python -c "import adaptive_fractionation_overlap; print('Package installed successfully')" | |
| python -c "from adaptive_fractionation_overlap.core_adaptfx import adaptfx_full; print('Core functions importable')" | |
| - name: Run constants tests | |
| run: | | |
| pytest tests/test_constants.py -v --tb=short | |
| - name: Run helper functions tests | |
| run: | | |
| pytest tests/test_helper_functions.py -v --tb=short | |
| - name: Run core adaptive fractionation tests | |
| run: | | |
| pytest tests/test_core_adaptfx.py -v --tb=short | |
| - name: Run fixture tests | |
| run: | | |
| pytest tests/test_fixtures.py -v --tb=short | |
| - name: Run all tests with coverage | |
| run: | | |
| pytest tests/ --cov=adaptive_fractionation_overlap --cov-report=xml --cov-report=term-missing | |
| test-edge-cases: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'pull_request' # Only run on PRs for thorough testing | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - 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 | |
| python -m pip install -e . | |
| python -m pip install pytest | |
| lint-and-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install linting tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install flake8 black isort | |
| - name: Check code formatting with black | |
| run: | | |
| black --check --diff adaptive_fractionation_overlap/ tests/ | |
| continue-on-error: true # Don't fail CI on formatting issues | |
| - name: Check import sorting with isort | |
| run: | | |
| isort --check-only --diff adaptive_fractionation_overlap/ tests/ | |
| continue-on-error: true | |
| - name: Lint with flake8 | |
| run: | | |
| # Stop the build if there are Python syntax errors or undefined names | |
| flake8 adaptive_fractionation_overlap/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # Exit-zero treats all errors as warnings. Line length is relaxed for scientific code | |
| flake8 adaptive_fractionation_overlap/ --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics | |
| continue-on-error: true | |
| test-package-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build twine | |
| - name: Build package | |
| run: | | |
| python -m build | |
| - name: Check package with twine | |
| run: | | |
| python -m twine check dist/* | |
| - name: Test installation from wheel | |
| run: | | |
| python -m pip install dist/*.whl | |
| python -c "import adaptive_fractionation_overlap; print('Wheel installation successful')" |