GaMELD #352
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
name: CI | |
on: | |
push: | |
branches: | |
pull_request: | |
banches: | |
- "master" | |
jobs: | |
unix: | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.name }} | |
env: | |
CCACHE_BASEDIR: "${{ github.workspace }}" | |
CCACHE_DIR: "${{ github.workspace }}/.ccache" | |
CCACHE_COMPRESS: true | |
CCACHE_COMPRESSLEVEL: 6 | |
CCACHE_MAXSIZE: 400M | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "Linux CUDA 11.8 Python 3.10" | |
os: ubuntu-latest | |
python-version: "3.10" | |
cuda-version: "11.8" | |
gcc-version: "9" | |
cdt-name: cos7 | |
CMAKE_FLAGS: | | |
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ | |
-DEXTRA_COMPILE_FLAGS="-L/usr/local/cuda/lib64/stubs -Wl,-rpath,/usr/local/cuda/lib64/stubs -Wl,-rpath-link,/usr/local/cuda/lib64/stubs" | |
- name: "Linux CUDA 11.8 Python 3.11" | |
os: ubuntu-latest | |
python-version: "3.11" | |
cuda-version: "11.8" | |
gcc-version: "9" | |
cdt-name: cos7 | |
CMAKE_FLAGS: | | |
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ | |
-DEXTRA_COMPILE_FLAGS="-L/usr/local/cuda/lib64/stubs -Wl,-rpath,/usr/local/cuda/lib64/stubs -Wl,-rpath-link,/usr/local/cuda/lib64/stubs" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Patch conda env (if needed)" | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sed -i -e "s/@CDT_NAME@/${{ matrix.cdt-name }}/g" \ | |
-e "s/@GCC_VERSION@/${{ matrix.gcc-version }}.*/g" \ | |
-e "s/@CUDATOOLKIT_VERSION@/${{ matrix.cuda-version }}.*/g" \ | |
devtools/ci/gh-actions/conda-envs/build-${{ matrix.os }}.yml | |
- uses: conda-incubator/setup-miniconda@v2 | |
name: "Prepare base dependencies" | |
with: | |
python-version: ${{ matrix.python-version }} | |
activate-environment: build | |
environment-file: devtools/ci/gh-actions/conda-envs/build-${{ matrix.os }}.yml | |
auto-activate-base: false | |
- name: "Install CUDA on Ubuntu (if needed)" | |
if: matrix.cuda-version != '' && startsWith(matrix.os, 'ubuntu') | |
env: | |
CUDA_VERSION: ${{ matrix.cuda-version }} | |
run: source devtools/ci/gh-actions/scripts/install_cuda.sh | |
- name: "Conda info" | |
shell: bash -l {0} | |
run: | | |
conda info -a | |
conda list | |
- name: "Prepare ccache" | |
id: prepare-ccache | |
shell: bash -l {0} | |
run: | | |
echo "::set-output name=key::$(echo "${{ matrix.name }}" | tr -d ' .')" | |
echo "::set-output name=timestamp::$(date +%Y%m%d-%H%M%S)" | |
ccache -p | |
ccache -z | |
- name: "Restore ccache" | |
uses: actions/[email protected] | |
with: | |
path: .ccache | |
key: ccache-${{ secrets.CACHE_VERSION }}-${{ steps.prepare-ccache.outputs.key }}-${{ steps.prepare-ccache.outputs.timestamp }} | |
restore-keys: | | |
ccache-${{ secrets.CACHE_VERSION }}-${{ steps.prepare-ccache.outputs.key }}- | |
- name: "Configure plugin build with CMake" | |
shell: bash -l {0} | |
run: | | |
mkdir build | |
cd build | |
cmake ../plugin \ | |
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | |
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DOPENMM_DIR=${CONDA_PREFIX} \ | |
${{ matrix.CMAKE_FLAGS }} | |
- name: "Build plugin" | |
shell: bash -l {0} | |
run: | | |
cd build | |
make -j2 install | |
- name: "Build plugin Python wrappers" | |
shell: bash -l {0} | |
run: | | |
cd build | |
make -j2 PythonInstall | |
- name: "Build MELD" | |
shell: bash -l {0} | |
run: | | |
python setup.py install | |
- name: "Check ccache performance" | |
shell: bash -l {0} | |
run: ccache -s | |
- name: "Test for presence of shared libraries" | |
shell: bash -l {0} | |
id: testcore | |
run: | | |
test -f ${CONDA_PREFIX}/lib/libMeldPlugin.so | |
test -f ${CONDA_PREFIX}/lib/plugins/libMeldPluginCUDA.so | |
- name: "Test MELD" | |
shell: bash -l {0} | |
if: ${{ !contains(matrix.CMAKE_FLAGS, 'OPENMM_BUILD_PYTHON_WRAPPERS=OFF') && (steps.testcore.outcome == 'failure' || steps.testcore.outcome == 'success') }} | |
run: | | |
set -x | |
python -m unittest discover meld.test | |
mypy --version | |
mypy meld | |
docs: | |
env: | |
CCACHE_BASEDIR: "${{ github.workspace }}" | |
CCACHE_DIR: "${{ github.workspace }}/.ccache" | |
CCACHE_COMPRESS: true | |
CCACHE_COMPRESSLEVEL: 6 | |
CCACHE_MAXSIZE: 400M | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: conda-incubator/setup-miniconda@v2 | |
name: "Prepare base dependencies" | |
with: | |
python-version: "3.8" | |
activate-environment: build | |
environment-file: devtools/ci/gh-actions/conda-envs/docs.yml | |
auto-activate-base: false | |
- name: "Prepare ccache" | |
id: prepare-ccache | |
shell: bash -l {0} | |
run: | | |
echo "::set-output name=key::$(echo "${{ matrix.name }}" | tr -d ' .')" | |
echo "::set-output name=timestamp::$(date +%Y%m%d-%H%M%S)" | |
ccache -p | |
ccache -z | |
- name: "Restore ccache" | |
uses: actions/[email protected] | |
with: | |
path: .ccache | |
key: ccache-${{ secrets.CACHE_VERSION }}-${{ steps.prepare-ccache.outputs.key }}-${{ steps.prepare-ccache.outputs.timestamp }} | |
restore-keys: | | |
ccache-${{ secrets.CACHE_VERSION }}-${{ steps.prepare-ccache.outputs.key }}- | |
- name: "Configure plugin build with CMake" | |
shell: bash -l {0} | |
run: | | |
cd plugin | |
mkdir build | |
cd build | |
cmake .. \ | |
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | |
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DOPENMM_DIR=${CONDA_PREFIX} \ | |
${{ matrix.CMAKE_FLAGS }} | |
- name: Build plugin docs | |
shell: bash -l {0} | |
run: | | |
set -x | |
cd plugin/build | |
make -j2 install PythonInstall | |
make -j2 DoxygenApiDocs | |
- name: Build docs | |
shell: bash -l {0} | |
run: | | |
set -x | |
cd docs | |
make html | |
- name: "Check ccache performance" | |
shell: bash -l {0} | |
run: ccache -s | |
- name: "Deploy docs (only on master)" | |
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'schedule' }} | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'us-west-2' | |
SOURCE_DIR: 'docs/_build/html' |