|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + name: Test Python ${{ matrix.python-version }} |
| 12 | + runs-on: ubuntu-latest |
| 13 | + if: false # Tests temporarily disabled |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + python-version: ["3.11", "3.12"] |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Set up Python ${{ matrix.python-version }} |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + |
| 28 | + - name: Install uv |
| 29 | + uses: astral-sh/setup-uv@v3 |
| 30 | + with: |
| 31 | + version: "latest" |
| 32 | + |
| 33 | + - name: Install dependencies |
| 34 | + run: | |
| 35 | + uv pip install --system -e . |
| 36 | + uv pip install --system pytest pytest-cov pytest-asyncio |
| 37 | +
|
| 38 | + - name: Run unit tests |
| 39 | + run: | |
| 40 | + pytest tests/unit/ -v --cov=faim_sdk --cov=faim_client --cov-report=xml --cov-report=term |
| 41 | +
|
| 42 | + - name: Upload coverage to Codecov |
| 43 | + uses: codecov/codecov-action@v4 |
| 44 | + if: matrix.python-version == '3.11' |
| 45 | + with: |
| 46 | + file: ./coverage.xml |
| 47 | + fail_ci_if_error: false |
| 48 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 49 | + |
| 50 | + test-examples: |
| 51 | + name: Test Examples |
| 52 | + runs-on: ubuntu-latest |
| 53 | + if: false # Tests temporarily disabled |
| 54 | + steps: |
| 55 | + - name: Checkout code |
| 56 | + uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Set up Python 3.11 |
| 59 | + uses: actions/setup-python@v5 |
| 60 | + with: |
| 61 | + python-version: "3.11" |
| 62 | + |
| 63 | + - name: Install uv |
| 64 | + uses: astral-sh/setup-uv@v3 |
| 65 | + with: |
| 66 | + version: "latest" |
| 67 | + |
| 68 | + - name: Install dependencies with viz extras |
| 69 | + run: | |
| 70 | + uv pip install --system -e ".[viz]" |
| 71 | + uv pip install --system jupyterlab pandas statsmodels |
| 72 | +
|
| 73 | + - name: Check example notebooks can be read |
| 74 | + run: | |
| 75 | + python -c "import nbformat; nbformat.read('examples/flowstate_simple_example.ipynb', as_version=4)" |
| 76 | + python -c "import nbformat; nbformat.read('examples/model_comparison_example.ipynb', as_version=4)" |
| 77 | + python -c "import nbformat; nbformat.read('examples/model_comparison_simple.ipynb', as_version=4)" |
| 78 | +
|
| 79 | + - name: Verify eval package imports |
| 80 | + run: | |
| 81 | + python -c "from faim_sdk.eval import mse, mase, crps_from_quantiles, plot_forecast; print('Eval imports successful')" |
0 commit comments