Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify conda weekly test #3467

Merged
merged 20 commits into from
Oct 11, 2024
75 changes: 29 additions & 46 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Conda install

on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
#push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
Expand All @@ -15,52 +15,35 @@ jobs:
name: Install and test
strategy:
matrix:
# NOTE: Re-enable windows-2022 after iimpi libfabric.dll issue fixed.
os: [ubuntu-latest, macos-13, macos-14]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
# This is necessary to ensure conda environment is activated in every step.
defaults:
run:
shell: bash -el {0}

steps:
- name: Install conda (macOS)
if: runner.os == 'macOS'
run: |
brew install anaconda
echo "/opt/homebrew/anaconda3/bin:/usr/local/anaconda3/bin" >> $GITHUB_PATH
- name: Update conda
run: |
conda update conda

- name: Install DOLFINx (py3-10)
run: |
conda create -n env3-10 -c conda-forge python=3.10 fenics-dolfinx mpich
conda env export -n env3-10
- name: Test (py3-10)
run: |
conda run -n env3-10 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-10 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"

- name: Install DOLFINx (py3-11)
run: |
conda create -n env3-11 -c conda-forge python=3.11 fenics-dolfinx mpich
conda env export -n env3-11
- name: Test (py3-11)
run: |
conda run -n env3-11 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-11 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"

- name: Install DOLFINx (py3-12)
run: |
conda create -n env3-12 -c conda-forge python=3.12 fenics-dolfinx mpich
conda env export -n env3-12
- name: Test (py3-12)
run: |
conda run -n env3-12 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"

- name: Install DOLFINx (py3-12, petsc-complex)
run: |
conda create -n env3-12-complex -c conda-forge python=3.12 fenics-dolfinx petsc=*=complex* mpich
conda env export -n env3-12-complex
- name: Test (py3-12-complex)
run: |
conda run -n env3-12-complex python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12-complex mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Install DOLFINx with MPICH (Unix-like)
if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }}
run: |
conda install -c conda-forge fenics-dolfinx mpich
- name: Install DOLFINx (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
conda install -c conda-forge fenics-dolfinx

- name: Test
run: |
conda info
conda list
mpiexec --version
mpiexec -v -np 1 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
mpiexec -v -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
Loading