add 'FuturesTimeoutError' #407
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
| # Surfaces CI/CD Pipeline | |
| # Tests package with minimal and full dependencies across multiple Python versions and OSes | |
| name: tests | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # =========================================================================== | |
| # Stage 1: Code Quality (Fast, runs first) | |
| # =========================================================================== | |
| code-quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files | |
| # =========================================================================== | |
| # Stage 2: Core Tests (NumPy only - algebraic, engineering, bbob) | |
| # =========================================================================== | |
| test-core: | |
| name: Core Tests (Py ${{ matrix.python-version }}, ${{ matrix.os }}) | |
| needs: code-quality | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| os: [ubuntu-latest] | |
| include: | |
| - os: macos-latest | |
| python-version: "3.11" | |
| - os: windows-latest | |
| 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: Install minimal dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test-minimal]" | |
| - name: Verify minimal install | |
| run: | | |
| python -c " | |
| import surfaces | |
| print(f'Surfaces version: {surfaces.__version__}') | |
| " | |
| - name: Run core tests | |
| run: python -m pytest -x -p no:warnings tests/core/ | |
| # =========================================================================== | |
| # Stage 3: Full Tests (sklearn, CEC, surrogates, visualization) | |
| # =========================================================================== | |
| test-full: | |
| name: Full Tests (Py ${{ matrix.python-version }}, ${{ matrix.os }}) | |
| needs: code-quality | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| os: [ubuntu-latest] | |
| include: | |
| - os: macos-latest | |
| python-version: "3.11" | |
| - os: windows-latest | |
| python-version: "3.11" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # XGBoost requires OpenMP runtime (libomp) on macOS | |
| - name: Install libomp (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install libomp | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install full dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test]" | |
| - name: Run core and full tests | |
| run: python -m pytest -x -p no:warnings tests/core/ tests/full/ | |
| # =========================================================================== | |
| # Stage 4: Integration Tests (Optimization library compatibility) | |
| # =========================================================================== | |
| test-integration: | |
| name: Integration Tests (Py ${{ matrix.python-version }}) | |
| needs: code-quality | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test]" | |
| pip install pytest | |
| pip install -r requirements/all_integrations.txt | |
| - name: Run integration tests | |
| run: python -m pytest -x -p no:warnings tests/integration/ | |
| # =========================================================================== | |
| # Stage 5: Internal Tests (private APIs: dashboard, surrogates) | |
| # =========================================================================== | |
| test-internal: | |
| name: Internal Tests | |
| needs: code-quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dashboard]" | |
| pip install pytest | |
| - name: Run internal tests | |
| run: python -m pytest -x -p no:warnings tests/internal/ | |
| # =========================================================================== | |
| # Stage 6: Coverage (only on Ubuntu, Python 3.11) | |
| # =========================================================================== | |
| coverage: | |
| name: Coverage | |
| needs: [test-core, test-full] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test]" | |
| - name: Run tests with coverage | |
| run: | | |
| python -m pytest tests/core/ tests/full/ \ | |
| --cov=surfaces \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml \ | |
| -p no:warnings | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| # =========================================================================== | |
| # Stage 7: Example Tests (examples/ directory) | |
| # =========================================================================== | |
| test-examples: | |
| name: Test Examples | |
| needs: code-quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test]" | |
| pip install -r requirements/all_integrations.txt | |
| - name: Run example tests | |
| run: python -m pytest examples/test_examples.py -v --tb=short | |
| # =========================================================================== | |
| # Stage 8: Documentation Snippet Tests | |
| # =========================================================================== | |
| test-doc-snippets: | |
| name: Test Doc Snippets | |
| needs: code-quality | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test]" | |
| pip install -r requirements/all_integrations.txt | |
| - name: Run documentation snippet tests | |
| run: python -m pytest docs/tests/test_doc_snippets.py -v --tb=short |