Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 136 additions & 19 deletions .github/workflows/alltests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- master
workflow_dispatch:

# CodeQL "Workflow does not contain permissions": restrict the GITHUB_TOKEN to
# the minimum. These jobs only read the repo -- checkout, conda/python setup,
# caching, and tests. Codecov uploads authenticate with CODECOV_TOKEN, not the
# GITHUB_TOKEN, so no write scope is needed.
permissions:
contents: read

concurrency:
# Keep push and pull_request runs separate so same-SHA PR updates do not inherit cancelled push checks.
group: alltests-${{ github.event_name }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.head_ref || github.ref_name }}
Expand Down Expand Up @@ -68,9 +75,36 @@ jobs:
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-activate-base: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
auto-activate-base: false
# Name the env explicitly: without this the active environment is
# ambiguous (base vs the auto-created `test`), which can leave pip
# and python pointing at different prefixes.
activate-environment: qmcpy-ci
conda-remove-defaults: true
use-only-tar-bz2: true

# Without python-version above, matrix.python-version reached only the job
# name and every job ran the conda base interpreter. Steps touching Python
# must use a profile-loading shell (bash -el / pwsh) to see the env.
- name: Verify interpreter matches the matrix (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: |
echo "which python : $(which python)"
echo "which pip : $(which pip)"
conda info --envs || true
python -c "import sys; print('prefix:',sys.prefix); print(sys.version)"
python -c "import sys; got='.'.join(map(str,sys.version_info[:2])); want='${{ matrix.python-version }}'; assert got==want, 'matrix says %s but interpreter is %s'%(want,got)"

- name: Verify interpreter matches the matrix (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-Command python | Format-List
conda info --envs
python -c "import sys; print('prefix:',sys.prefix); print(sys.version)"
python -c "import sys; got='.'.join(map(str,sys.version_info[:2])); want='${{ matrix.python-version }}'; assert got==want, 'matrix says %s but interpreter is %s'%(want,got)"

# -----------------------------------------------------------
# Clean old coverage files
Expand Down Expand Up @@ -222,18 +256,22 @@ jobs:

- name: Build and cache wheels (Linux)
if: runner.os == 'Linux'
shell: bash -el {0}
run: |
python -m pip wheel -w ./.wheels .[test,test_torch,test_gpytorch,test_botorch,test_umbridge] || true
python -m pip wheel -w ./.wheels ".[test,test_torch,test_gpytorch,test_botorch,test_umbridge]" || true
- name: Install Python dependencies (Linux)
if: runner.os == 'Linux'
shell: bash -el {0}
run: |
pip install --find-links ./.wheels -e ".[test,test_torch,test_gpytorch,test_botorch,test_umbridge]"
- name: Build and cache wheels (macOS)
if: runner.os == 'macOS'
shell: bash -el {0}
run: |
python -m pip wheel -w ./.wheels .[test,test_torch,test_gpytorch,test_botorch] || true
python -m pip wheel -w ./.wheels ".[test,test_torch,test_gpytorch,test_botorch]" || true
- name: Install Python dependencies (macOS)
if: runner.os == 'macOS'
shell: bash -el {0}
run: |
pip install --find-links ./.wheels -e ".[test,test_torch,test_gpytorch,test_botorch]"
- name: Build and cache wheels (Windows)
Expand All @@ -246,12 +284,25 @@ jobs:
shell: pwsh
run: |
pip install --find-links ./.wheels -e '.[test,test_torch,test_gpytorch,test_botorch]'
- name: Install MPMC dependencies
run: |
qmcpy-install-mpmc
- name: Validate MPMC dependencies
run: |
python -c "import torch, pyg_lib, torch_geometric; print(f'torch={torch.__version__}'); print('MPMC dependencies ready')"
- name: Install MPMC dependencies (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: qmcpy-install-mpmc

- name: Install MPMC dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: qmcpy-install-mpmc

- name: Validate MPMC dependencies (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: python -c "import torch, pyg_lib, torch_geometric; print(f'torch={torch.__version__}'); print('MPMC dependencies ready')"

- name: Validate MPMC dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: python -c "import torch, pyg_lib, torch_geometric; print(f'torch={torch.__version__}'); print('MPMC dependencies ready')"
# -----------------------------------------------------------
# Install minimal LaTeX required by Jupyter notebooks (OS-specific)
# -----------------------------------------------------------
Expand Down Expand Up @@ -375,7 +426,7 @@ jobs:
Invoke-WithRetry -Description "Refresh MiKTeX package database" -Script {
mpm --admin --update-db
}
$packages = @('latexmk','dvipng','cm-super','lmodern','type1cm','tex-gyre')
$packages = @('latexmk','dvipng','cm-super','lmodern','type1cm','tex-gyre','l3backend')
foreach ($pkg in $packages) {
Invoke-WithRetry -Description "Install MiKTeX package $pkg" -Script {
mpm --admin --install=$pkg
Expand All @@ -386,19 +437,71 @@ jobs:
Invoke-WithRetry -Description "Refresh MiKTeX filename database" -Script {
initexmf --admin --update-fndb
}
$L3BackendPath = kpsewhich l3backend-dvips.def
if ([string]::IsNullOrWhiteSpace($L3BackendPath)) {
throw "MiKTeX install did not provide l3backend-dvips.def"
}
latex --version
latexmk -v
dvipng --version

# -----------------------------------------------------------
# Run doctests (OS-specific)
# -----------------------------------------------------------
- run: pip freeze
- run: make doctests_minimal
- run: make doctests_torch
- run: make doctests_gpytorch
- run: make doctests_botorch
- run: make doctests_markdown
- name: pip freeze (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: pip freeze

- name: pip freeze (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: pip freeze
- name: doctests_minimal (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make doctests_minimal

- name: doctests_minimal (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make doctests_minimal
- name: doctests_torch (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make doctests_torch

- name: doctests_torch (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make doctests_torch
- name: doctests_gpytorch (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make doctests_gpytorch

- name: doctests_gpytorch (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make doctests_gpytorch
- name: doctests_botorch (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make doctests_botorch

- name: doctests_botorch (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make doctests_botorch
- name: doctests_markdown (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make doctests_markdown

- name: doctests_markdown (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make doctests_markdown
- name: Run umbridge doctests on Linux full sweeps when Docker is available
shell: bash -l {0}
run: |
Expand All @@ -411,12 +514,26 @@ jobs:
else
echo "Skipping umbridge doctests because Docker is not available on this runner"
fi
- name: Run MPMC doctests
- name: Run MPMC doctests (Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make doctests_mpmc

- name: Run MPMC doctests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make doctests_mpmc
# -----------------------------------------------------------
# Run unittests for Python source files
# -----------------------------------------------------------
- name: Run unittests (parallel)
- name: Run unittests (parallel, Unix)
if: runner.os != 'Windows'
shell: bash -el {0}
run: make unittests

- name: Run unittests (parallel, Windows)
if: runner.os == 'Windows'
shell: pwsh
run: make unittests

# -----------------------------------------------------------
Expand Down
Loading
Loading