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

Cron compilers #5

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open
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
223 changes: 223 additions & 0 deletions .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
name: GH Actions Cron CI
on:
push:
branches:
- cron-compilers

# schedule:
# - cron: '*/10 * * * *'

defaults:
run:
shell: bash -l {0}

env:
MDA_CONDA_MIN_DEPS: "pip pytest==6.1.2 mmtf-python biopython networkx cython matplotlib-base scipy griddataformats hypothesis gsd codecov"
MDA_CONDA_EXTRA_DEPS: "seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles tqdm>=4.43.0 tidynamics>=1.0.0 rdkit>=2020.03.1 h5py==2.10.0"
MDA_PIP_MIN_DEPS: 'coveralls coverage<5 pytest-cov pytest-xdist'
MDA_PIP_EXTRA_DEPS: 'duecredit parmed'
OMP_NUM_THREADS: 1


jobs:
numpy_dev:
runs-on: ubuntu-latest
env:
CYTHON_TRACE_NOGIL: 1
MPLBACKEND: agg
steps:
- uses: actions/checkout@v2
- name: setup_compilers
run: |
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
echo "FC=gfortran-10" >> $GITHUB_ENV

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
auto-update-conda: true
channel-priority: flexible
channels: biobuilds, conda-forge
add-pip-as-python-dependency: true
mamba-version: "*"
architecture: x64

- name: build_numpy
run: |
git clone https://github.com/numpy/numpy.git
(cd numpy && pip install .)

- name: install_deps
env:
MDA_CONDA_FULL_DEPS: "${{ env.MDA_CONDA_MIN_DEPS }}"
MDA_PIP_FULL_DEPS: "${{ env.MDA_PIP_MIN_DEPS }}"
run: |
conda_deps=${MDA_CONDA_MIN_DEPS}
pip_deps=${MDA_PIP_MIN_DEPS}
mamba install ${conda_deps}
pip install ${pip_deps}

- name: check_setup
run: |
# Check OS and python setup
echo "OS: ${{ matrix.os }}"
which python
which pip
pip list
conda info
conda list

- name: install_mda
run: |
(cd package/ && python setup.py develop) && (cd testsuite/ && python setup.py install)

- name: run_tests
run: |
pytest -n 2 testsuite/MDAnalysisTests --durations=50

# long term separate clang and gcc once ubuntu+clang is fixed
compiler_sweep:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ]
python-version: [3.8, ]
compiler-version: [7, 8, 9, 10]
compiler: [gcc, ]
include:
- name: ubuntu-18-gcc6
os: ubuntu-18.04
python-version: 3.8
compiler-version: 7
compiler: gcc
- name: ubuntu-16-gcc5
os: ubuntu-16.04
python-version: 3.8
compiler-version: 5
compiler: gcc
- name: macOS-Catalina-clang12
os: macOS-10.15
python-version: 3.8
compiler-version: 12
compiler: clang
- name: macOS-Catalina-clang11
os: macOS-10.15
python-version: 3.8
compiler-version: 11
compiler: clang
env:
CYTHON_TRACE_NOGIL: 1
MPLBACKEND: agg

steps:
- uses: actions/checkout@v2

- name: setup_osx
if: startsWith(matrix.os, 'macOS')
run: |
echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV
ulimit -S -n 2048

# clang macOS definitions are different than the ubuntu runners
- name: setup_osx_clang
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.compiler, 'clang')
run: |
if [[ ${{ matrix.compiler-version }} == 11 ]]; then
$(brew --prefix llvm)/bin/clang --version
echo "CC=$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
$(brew --prefix llvm)/bin/clang++ --version
echo "CXX=$(brew --prefix llvm)/bin/clang++" >> $GITHUB_ENV
else
# clang-12 isn't defined for some reason
clang --version
echo "CC=clang" >> $GITHUB_ENV
clang++ --version
echo "CXX=clang++" >> $GITHUB_ENV
fi

# no clang fortran compiler, default to gfortran 10
if gfortran-10 --version &> /dev/null
then
echo "HOLE2=true" >> $GITHUB_ENV
echo "FC=$GFORT" >> $GITHUB_ENV
else
echo "HOLE2=false" >> $GITHUB_ENV
fi

- name: setup_gcc_compilers
if: startsWith(matrix.compiler, 'gcc')
env:
GCC: "gcc-${{ matrix.compiler-version }}"
GXX: "g++-${{ matrix.compiler-version }}"
GFORT: "gfortran-${{matrix.compiler-version }}"
run: |
# Set OS specific vars and compiler flags
$GCC --version
echo "CC=${GCC}" >> $GITHUB_ENV
$GXX --version
echo "CXX=${GXX}" >> $GITHUB_ENV
if $GFORT --version &> /dev/null
then
echo "HOLE2=true" >> $GITHUB_ENV
echo "FC=$GFORT" >> $GITHUB_ENV
else
echo "HOLE2=false" >> $GITHUB_ENV
fi

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channel-priority: flexible
channels: biobuilds, conda-forge
add-pip-as-python-dependency: true
mamba-version: "*"
architecture: x64

- name: install_deps
env:
MDA_CONDA_FULL_DEPS: "${{ env.MDA_CONDA_MIN_DEPS }} ${{ env.MDA_CONDA_EXTRA_DEPS }}"
MDA_PIP_FULL_DEPS: "${{ env.MDA_PIP_MIN_DEPS }} ${{ env.MDA_PIP_EXTRA_DEPS }}"
run: |
# NOTE: vars need to be re-assigned
# NOTE: set matrix.numpy to pin to a specific numpy version
conda_deps="numpy ${MDA_CONDA_FULL_DEPS}"
pip_deps=${MDA_PIP_FULL_DEPS}
mamba install ${conda_deps}
pip install ${pip_deps}

- name: check_setup
run: |
# Check OS and python setup
echo "OS: ${{ matrix.os }}"
which python
which pip
pip list
conda info
conda list

- name: install_hole
if : ${{ env.HOLE2 == 'true' }}
run: |
# We manually build hole2 to avoid OS incompatibilities
git clone https://github.com/MDAnalysis/hole2.git
cd hole2/src
source ../source.apache
(make FC=${FC}) && (make PREFIX=${HOME}/hole2 FC=${FC} install)
source ../source.unset
echo "HOLE_BINDIR=${HOME}/hole2/bin" >> $GITHUB_ENV
echo "${HOME}/hole2/bin" >> $GITHUB_PATH

- name: install_mda
run: |
(cd package/ && python setup.py develop) && (cd testsuite/ && python setup.py install)

- name: run_tests
run: |
PYTEST_FLAGS="--disable-pytest-warnings --durations=50"
echo $PYTEST_FLAGS
pytest -n 2 testsuite/MDAnalysisTests $PYTEST_FLAGS