Parameter dataclass refactoring #121
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Cache PDM dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/pdm | |
| .pdm-build | |
| key: ${{ runner.os }}-pdm-${{ hashFiles('**/pdm.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pdm- | |
| - name: Install PDM | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pdm | |
| - name: Install dependencies | |
| run: | | |
| pdm install --check --no-lock -G test | |
| - name: Check code formatting (Black) | |
| id: black | |
| run: | | |
| pdm run black --check . | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Cache PDM dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/pdm | |
| .pdm-build | |
| key: ${{ runner.os }}-pdm-${{ hashFiles('**/pdm.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pdm- | |
| - name: Install PDM | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pdm | |
| - name: Install dependencies | |
| run: | | |
| pdm install --check --no-lock -G test | |
| - name: Run flake8 | |
| id: flake8 | |
| run: | | |
| pdm run flake8 | |
| - name: Help - Flake8 | |
| if: failure() && steps.flake8.outcome == 'failure' | |
| run: | | |
| echo "::error::❌ Flake8 check failed." | |
| echo "To fix this, run the following command locally:" | |
| echo " pdm run flake8" | |
| - name: Run mypy | |
| id: mypy | |
| continue-on-error: true # Allow failure until codebase is fully typed | |
| run: | | |
| pdm run mypy . | |
| - name: Help - Mypy | |
| if: steps.mypy.outcome == 'failure' | |
| run: | | |
| echo "::warning::⚠️ Mypy check failed (non-blocking)." | |
| echo "To view these errors locally, run:" | |
| echo " pdm run mypy ." | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache PDM dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .venv | |
| .pdm-build | |
| key: ${{ runner.os }}-pdm-${{ matrix.python-version }}-${{ hashFiles('**/pdm.lock') }} | |
| - name: Install PDM | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pdm | |
| - name: Install dependencies | |
| run: | | |
| pdm install --check --no-lock -G test | |
| - name: Run Unit Tests | |
| id: unit | |
| run: pdm run pytest tests/unit --cov-report=xml | |
| - name: Run Integration & Regression Tests | |
| id: integration | |
| if: success() || steps.unit.conclusion == 'failure' | |
| run: pdm run pytest tests/integration tests/regression -m "not slow" --cov-report=xml --cov-append | |
| - name: Run Other Tests (Robustness, Validation, Demo) | |
| if: success() || steps.unit.conclusion == 'failure' || steps.integration.conclusion == 'failure' | |
| run: pdm run pytest tests/robustness tests/validation tests/demo -m "not slow" --cov-report=xml --cov-append | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| plot: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ "3.11" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache PDM dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-pdm-${{ matrix.python-version }}-${{ hashFiles('**/pdm.lock') }} | |
| - name: Install PDM | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pdm | |
| - name: Install dependencies | |
| run: | | |
| pdm install --check --no-lock -G test | |
| - name: Generate Plot Artifacts | |
| id: plot | |
| run: pdm run plot_test | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test_output_${{ matrix.python-version }} | |
| path: tests/output |