Merge pull request #14 from geohang/copilot/fix-test-failing-job #76
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: tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: "test (ubuntu, py3.11)" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install test dependencies | |
| run: python -m pip install -e . pytest pyarrow "pygimli>=1.5.5,<2.0" | |
| - name: Import smoke test | |
| run: python -c "import PyHydroGeophysX; print('Import OK:', PyHydroGeophysX.__version__)" | |
| - name: Run tests | |
| run: pytest -q | |
| adtlert: | |
| name: "ADTLERT selection and CPU fallback (ubuntu, py3.11)" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install ADTLERT selection dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| python -m pip install -e . pytest | |
| python -m pip install "adtlert>=0.1,<0.2" "pygimli>=1.5.5,<2.0" | |
| - name: Run ADTLERT integration tests | |
| run: >- | |
| pytest -q | |
| tests/test_ert_backend_selection.py | |
| tests/test_ert_adtlert_backend.py | |
| tests/test_ert_mesh_import.py | |
| adtlert-windows: | |
| name: "ADTLERT Windows metadata and engine fallback (py3.11)" | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install ADTLERT fallback test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| python -m pip install -e . pytest | |
| python -m pip install "adtlert>=0.1,<0.2" "pygimli>=1.5.5,<2.0" | |
| - name: Verify CUDA 12 and Windows cuDSS metadata | |
| shell: python | |
| run: | | |
| import pathlib | |
| import tomllib | |
| project = tomllib.loads(pathlib.Path("pyproject.toml").read_text()) | |
| dependencies = project["project"]["optional-dependencies"] | |
| assert any("cupy-cuda12x" in item for item in dependencies["gpu"]) | |
| assert any("cupy-cuda12x" in item for item in dependencies["adtlert"]) | |
| assert any("nvidia-cudss-cu12" in item for item in dependencies["adtlert"]) | |
| assert any("nvmath-python" in item for item in dependencies["adtlert"]) | |
| - name: Run ADTLERT selection tests | |
| run: >- | |
| pytest -q | |
| tests/test_ert_backend_selection.py | |
| tests/test_ert_adtlert_backend.py |