-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from connorjward/JDBetteridge/enable_ci
Enable CI testing (3.10, 3.11 only)
- Loading branch information
Showing
4 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Testing | ||
|
||
# Trigger the workflow on push or pull request, | ||
# but only for the master branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# Don't immediately kill all if one Python version fails | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
env: | ||
CC: mpicc | ||
PETSC_DIR: ${{ github.workspace }}/petsc | ||
PETSC_ARCH: default | ||
PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 --with-c2html=0 --with-fortran-bindings=0 | ||
RDMAV_FORK_SAFE: 1 | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
- name: Install system dependencies | ||
shell: bash | ||
run: | | ||
sudo apt update | ||
sudo apt install build-essential mpich libmpich-dev \ | ||
libblas-dev liblapack-dev gfortran | ||
- name: Set correct Python version | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Clone PETSc | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: firedrakeproject/petsc | ||
path: ${{ env.PETSC_DIR }} | ||
|
||
- name: Build and install PETSc | ||
shell: bash | ||
working-directory: ${{ env.PETSC_DIR }} | ||
run: | | ||
./configure ${PETSC_CONFIGURE_OPTIONS} | ||
make | ||
- name: Build and install petsc4py | ||
# Remove this step when Firedrake PETSc branch is updated to support | ||
# building petsc4py with Cython>=3.0 | ||
shell: bash | ||
working-directory: ${{ env.PETSC_DIR }}/src/binding/petsc4py | ||
run: | | ||
pip install --upgrade pip | ||
pip install --upgrade wheel 'cython<3' numpy | ||
pip install --no-deps . | ||
- name: Checkout pyop3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: pyop3 | ||
|
||
- name: Install pyop3 and testing dependencies | ||
shell: bash | ||
working-directory: pyop3 | ||
run: | | ||
# Gross: | ||
pip install toml | ||
python scripts/requirements.py build | pip install -r /dev/stdin | ||
pip install --no-build-isolation . | ||
python scripts/requirements.py run | pip install -r /dev/stdin | ||
pip install pytest pytest-cov pytest-timeout pytest-xdist pytest-timeout | ||
- name: Run tests | ||
shell: bash | ||
working-directory: pyop3 | ||
run: | | ||
pytest \ | ||
--durations=200 \ | ||
--tb=native \ | ||
--cov pyop3 \ | ||
--timeout=480 \ | ||
--timeout-method=thread \ | ||
-o faulthandler_timeout=540 \ | ||
-n 12 --dist worksteal \ | ||
-v tests | ||
timeout-minutes: 10 | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sys | ||
|
||
import toml | ||
|
||
pyproject = toml.load("pyproject.toml") | ||
if "build" in sys.argv: | ||
packages = pyproject["build-system"]["requires"] | ||
elif "run" in sys.argv: | ||
packages = pyproject["project"]["dependencies"] | ||
|
||
print("\n".join([pkg for pkg in packages if pkg != "petsc4py"])) |