Skip to content
Merged
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
40 changes: 40 additions & 0 deletions .github/configs/conda-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# =================================================================================================
# This code is part of PyLith, developed through the Computational Infrastructure
# for Geodynamics (https://github.com/geodynamics/pylith).
#
# Copyright (c) 2010-2026 All rights reserved.
#
# See https://mit-license.org/ and LICENSE.md and for license information.
# =================================================================================================
# micromamba environment for Ubuntu with the pylith build dependencies
name: ci-conda

channels:
- conda-forge

dependencies:
- gxx
- clang-format
- python
- python-gil
- libpython
- setuptools
- cmake
- autoconf
- automake
- libtool
- make
- lcov
- zlib
- swig
- catch2
- cpptrace
- openmpi
- hdf5=1.14.6=mpi_openmpi*
- h5py=3.16.0=mpi_openmpi*
- netcdf4
- proj
- proj-data
- pyyaml

# End of file
102 changes: 102 additions & 0 deletions .github/workflows/pr-conda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: pr-conda

on:
- workflow_call
# and manually
- workflow_dispatch

jobs:
# build and test the ref that launched this action against a conda-forge toolchain
tests:
name: ${{matrix.target}}-${{matrix.os}}
runs-on: ${{matrix.os}}
# a login shell so the micromamba environment is active in every step
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
target: [opt]
include:
- os: ubuntu-latest
environment-file: pythia/.github/configs/conda-ubuntu.yaml
toolchain: gcc gxx
cc: mpicc
cxx: mpicxx
- target: opt
cflags: -Wall -g -O3
cxxflags: -Wall -g -O3
env:
PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe"
OMPI_MCA_smsc: "^cma"
OMPI_MCA_pml: "ob1"
OMPI_MCA_btl: "self,sm,tcp"
OMPI_MCA_btl_tcp_if_include: "lo"

steps:
- name: checkout pythia
uses: actions/checkout@v7
with:
fetch-depth: 0
path: pythia
submodules: recursive

- name: conda-forge environment
uses: mamba-org/setup-micromamba@v3
with:
micromamba-version: latest
environment-file: ${{matrix.environment-file}}
# conda-forge only, with strict priority so nothing leaks in from defaults
condarc: |
channels:
- conda-forge
channel_priority: strict
create-args: >-
${{matrix.toolchain}}

- name: versions
run: |
echo " -- conda prefix"
echo "${CONDA_PREFIX}"
echo " -- make"
make --version
echo " -- C compiler"
${{matrix.cc}} --version
echo " -- C++ compiler"
${{matrix.cxx}} --version
echo " -- python"
python3 --version
echo " -- prefix"
python3-config --prefix
echo " -- includes"
python3-config --includes
echo " -- libs"
python3-config --libs
echo " -- platform tag from python"
python3 -c "import sys; print(sys.platform)"
echo " -- distribution tag from python"
python3 -c "import platform as p; v = p.mac_ver()[0]; print(f'macOS {v}' if v else p.freedesktop_os_release()['PRETTY_NAME'])"

- name: build pythia
run: |
echo " -- switching to the pythia source directory"
cd pythia
autoreconf --install --verbose --force
echo " -- creating build directory"
mkdir ../pythia-build && cd ../pythia-build
echo " -- configure pythia"
../pythia/configure --enable-testing --without-build-isolation --prefix=${CONDA_PREFIX} CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} CFLAGS="${{matrix.cflags}}" CXXFLAGS="${{matrix.cxxflags}}"
echo " -- building pythia into the conda prefix"
make -j$(nproc) install

- name: test pythia
run: |
echo " -- switching to the pythia build directory"
cd pythia-build
echo " -- running pythia tests"
make -j$(nproc) check


# end of file
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
- debian-stable
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout pythia
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive

- name: Build Docker image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:

runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout pythia
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive

- name: Build Docker image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:

jobs:
stage-1:
uses: ./.github/workflows/ci-stage-1.yml
uses: ./.github/workflows/pr-stage-1.yaml
stage-2:
uses: ./.github/workflows/ci-stage-2.yml
uses: ./.github/workflows/pr-stage-2.yaml
needs: [stage-1]
conda:
uses: ./.github/workflows/pr-conda.yaml
needs: [stage-1]
Loading