-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add GitHub actions for macOS using `firedrake-install` and `pip install firedrake`. These will only run on PRs labelled "macOS" (or on pushes to master). * Fixups to pyproject.toml --------- Co-authored-by: Josh Hope-Collins <[email protected]> Co-authored-by: David A. Ham <[email protected]>
- Loading branch information
1 parent
ded8f14
commit fdfc908
Showing
8 changed files
with
229 additions
and
20 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,58 @@ | ||
name: Install and test Firedrake (macOS) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
# By default this workflow is run on the "opened", "synchronize" and | ||
# "reopened" events. We add "labelled" so it will run if the PR is given a label. | ||
types: [opened, synchronize, reopened, labeled] | ||
|
||
concurrency: | ||
# Cancels jobs running if new commits are pushed | ||
group: > | ||
${{ github.workflow }}- | ||
${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build Firedrake (macOS) | ||
runs-on: [self-hosted, macOS] | ||
# Only run this action if we are pushing to master or the PR is labelled "macOS" | ||
if: ${{ (github.ref == 'refs/heads/master') || contains(github.event.pull_request.labels.*.name, 'macOS') }} | ||
env: | ||
FIREDRAKE_CI_TESTS: 1 # needed to symlink the checked out branch into the venv | ||
OMP_NUM_THREADS: 1 | ||
OPENBLAS_NUM_THREADS: 1 | ||
steps: | ||
- name: Add homebrew to PATH | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path | ||
run: echo "/opt/homebrew/bin" >> "$GITHUB_PATH" | ||
- uses: actions/checkout@v4 | ||
- name: Pre-run cleanup | ||
if: ${{ always() }} | ||
run: | | ||
cd .. | ||
rm -rf firedrake_venv | ||
- name: Install Python | ||
run: brew install python python-setuptools | ||
- name: Build Firedrake | ||
run: | | ||
cd .. | ||
"$(brew --prefix)/bin/python3" \ | ||
firedrake/scripts/firedrake-install \ | ||
--venv-name firedrake_venv \ | ||
--disable-ssh \ | ||
|| (cat firedrake-install.log && /bin/false) | ||
- name: Run smoke tests | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
python -m pytest -v tests/firedrake/regression/ -k "poisson_strong or stokes_mini or dg_advection" | ||
timeout-minutes: 30 | ||
- name: Post-run cleanup | ||
if: ${{ always() }} | ||
run: | | ||
cd .. | ||
rm -rf firedrake_venv |
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,127 @@ | ||
name: Pip install Firedrake (macOS) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
# By default this workflow is run on the "opened", "synchronize" and | ||
# "reopened" events. We add "labelled" so it will run if the PR is given a label. | ||
types: [opened, synchronize, reopened, labeled] | ||
|
||
concurrency: | ||
# Cancels jobs running if new commits are pushed | ||
group: > | ||
${{ github.workflow }}- | ||
${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: "Build Firedrake using pip (macOS)" | ||
runs-on: [self-hosted, macOS] | ||
# Only run this action if we are pushing to master or the PR is labelled "macOS" | ||
if: ${{ (github.ref == 'refs/heads/master') || contains(github.event.pull_request.labels.*.name, 'macOS') }} | ||
env: | ||
OMP_NUM_THREADS: 1 | ||
OPENBLAS_NUM_THREADS: 1 | ||
steps: | ||
- name: Add homebrew to PATH | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path | ||
run: echo "/opt/homebrew/bin" >> "$GITHUB_PATH" | ||
|
||
- name: Install homebrew packages | ||
run: brew install gcc autoconf pkg-config make automake cmake ninja libtool boost openblas python python-setuptools mpich | ||
|
||
- name: Cleanup (pre) | ||
if: ${{ always() }} | ||
run: | | ||
rm -rf pip_venv | ||
"$(brew --prefix)/bin/python3" -m pip cache purge | ||
- name: Create a virtual environment | ||
run: | | ||
"$(brew --prefix)/bin/python3" -m venv pip_venv | ||
mkdir pip_venv/src | ||
- name: Install PETSc | ||
run: | | ||
cd pip_venv/src | ||
git clone https://github.com/firedrakeproject/petsc.git | ||
cd petsc | ||
./configure PETSC_DIR="$PWD" PETSC_ARCH=default \ | ||
--with-shared-libraries=1 \ | ||
--with-mpi-dir=/opt/homebrew \ | ||
--with-zlib \ | ||
--download-bison \ | ||
--download-hdf5 \ | ||
--download-hwloc \ | ||
--download-hypre \ | ||
--download-metis \ | ||
--download-mumps \ | ||
--download-netcdf \ | ||
--download-pastix \ | ||
--download-pnetcdf \ | ||
--download-ptscotch \ | ||
--download-scalapack \ | ||
--download-suitesparse \ | ||
--download-superlu_dist | ||
make | ||
- name: Install libsupermesh | ||
run: | | ||
source pip_venv/bin/activate | ||
python -m pip install 'rtree>=1.2' | ||
cd pip_venv/src | ||
git clone https://github.com/firedrakeproject/libsupermesh.git | ||
mkdir -p libsupermesh/build | ||
cd libsupermesh/build | ||
cmake .. \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \ | ||
-DMPI_C_COMPILER=/opt/homebrew/bin/mpicc \ | ||
-DMPI_CXX_COMPILER=/opt/homebrew/bin/mpicxx \ | ||
-DMPI_Fortran_COMPILER=/opt/homebrew/bin/mpif90 \ | ||
-DCMAKE_Fortran_COMPILER=/opt/homebrew/bin/mpif90 \ | ||
-DMPIEXEC_EXECUTABLE=/opt/homebrew/bin/mpiexec | ||
make | ||
make install | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: pip_venv/src/firedrake | ||
|
||
- name: Pip install | ||
run: | | ||
export PETSC_DIR="$PWD/pip_venv/src/petsc" | ||
export PETSC_ARCH=default | ||
export HDF5_DIR="$PETSC_DIR/$PETSC_ARCH" | ||
export HDF5_MPI=ON | ||
export CC=/opt/homebrew/bin/mpicc | ||
export CXX=/opt/homebrew/bin/mpicxx | ||
export MPICC="$CC" | ||
source pip_venv/bin/activate | ||
cd pip_venv/src | ||
python -m pip install \ | ||
--log=firedrake-install.log \ | ||
--no-binary h5py \ | ||
-v -e './firedrake[test]' | ||
- name: Install CI-specific test dependencies | ||
run: | | ||
source pip_venv/bin/activate | ||
python -m pip install -U pytest-timeout | ||
- name: Run Firedrake smoke tests | ||
run: | | ||
source pip_venv/bin/activate | ||
cd pip_venv/src/firedrake | ||
python -m pytest --timeout=1800 -v tests/firedrake/regression \ | ||
-k "poisson_strong or stokes_mini or dg_advection" | ||
timeout-minutes: 30 | ||
|
||
- name: Cleanup (post) | ||
if: ${{ always() }} | ||
run: | | ||
rm -rf pip_venv | ||
"$(brew --prefix)/bin/python3" -m pip cache purge |
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
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