Skip to content

Commit e20fa9f

Browse files
author
Charlles Abreu
authored
Adds workflow for building conda packages (#6)
* Changed conda package name * Changed workflow name * Added conda-build actions workflow * Fixed bug * Changed docs workflow * Added osx-64 platform to conda workflow * Further workflow changes * Fixed Linux workflow * Bug fix * Simplified build workflows * Updated Docs workflow * Bug fix * Fixed file and conda envs names * Updated README.md * Fixed link
1 parent fb8e284 commit e20fa9f

File tree

10 files changed

+175
-136
lines changed

10 files changed

+175
-136
lines changed

.github/workflows/Conda.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Conda
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
pull_request:
8+
branches:
9+
- "main"
10+
11+
jobs:
12+
test:
13+
name: Build and deploy ${{ matrix.platform }} packages
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
include:
18+
- platform: linux-64
19+
os: ubuntu-latest
20+
21+
- platform: osx-64
22+
os: macos-latest
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Additional info about the build
28+
shell: bash
29+
run: |
30+
uname -a
31+
df -h
32+
ulimit -a
33+
34+
- uses: mamba-org/provision-with-micromamba@main
35+
with:
36+
environment-file: devtools/conda-envs/conda-build.yml
37+
environment-name: build
38+
channels: conda-forge
39+
extra-specs: |
40+
python=3.11
41+
42+
- name: Conda Build and Upload
43+
shell: bash -l {0}
44+
working-directory: ./devtools/conda-recipes/anaconda
45+
run: |
46+
export PLUGIN_VERSION=${{ github.ref_name }}
47+
export PLUGIN_VERSION=v0.0.0
48+
echo "::group::Building conda package for version $PLUGIN_VERSION"
49+
outdir=$(mktemp -d)
50+
conda mambabuild . --no-anaconda-upload --variants "{platform: ${{ matrix.platform }}}" --output-folder $outdir
51+
echo "::endgroup::"
52+
echo "::group::Uploading packages to mdtools conda channel"
53+
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
54+
PACKAGES=$(find $outdir -name openmm-cpp-forces-*.tar.bz2)
55+
anaconda upload --user mdtools --force --label main $PACKAGES
56+
echo "::endgroup::"

.github/workflows/Doc.yml renamed to .github/workflows/Docs.yml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Doc
1+
name: Docs
22

33
on:
44
push:
@@ -10,40 +10,41 @@ on:
1010

1111
jobs:
1212
unix:
13-
runs-on: macos-11
14-
name: Doc (Python ${{ matrix.python-version }})
13+
runs-on: ${{ matrix.os }}
14+
name: Build and Deploy to GitHub Pages
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- python-version: "3.10"
19+
- os: ubuntu-20.04
20+
python-version: "3.11"
21+
openmm-version: "8.1"
22+
gcc-version: "13"
2023

2124
steps:
2225
- name: "Check out"
2326
uses: actions/checkout@v3
24-
with:
25-
token: ${{ secrets.REPO_TOKEN }}
26-
27-
- name: "Install SDK on MacOS"
28-
run: source devtools/scripts/install_macos_sdk.sh
2927

30-
- name: "Update the conda enviroment file"
31-
uses: cschleiden/replace-tokens@v1
32-
with:
33-
tokenPrefix: '@'
34-
tokenSuffix: '@'
35-
files: devtools/conda-envs/build-macos-11.yml
28+
- name: "Additional info about the build"
29+
shell: bash
30+
run: |
31+
uname -a
32+
df -h
33+
ulimit -a
3634
37-
- uses: conda-incubator/setup-miniconda@v2
38-
name: "Install dependencies with conda"
35+
- name: "Install Micromamba"
36+
uses: mamba-org/setup-micromamba@v1
3937
with:
40-
activate-environment: build
41-
environment-file: devtools/conda-envs/build-doc.yml
42-
python-version: ${{ matrix.python-version }}
38+
environment-file: devtools/conda-envs/build-docs.yml
39+
environment-name: docs
40+
create-args: >-
41+
python=${{ matrix.python-version }}
42+
gxx_linux-64=${{ matrix.gcc-version }}
43+
openmm=${{ matrix.openmm-version }}
4344
4445
- name: "List conda packages"
4546
shell: bash -l {0}
46-
run: conda list
47+
run: micromamba list
4748

4849
- name: "Configure"
4950
shell: bash -l {0}
@@ -52,19 +53,20 @@ jobs:
5253
cd build
5354
cmake -DCMAKE_BUILD_TYPE=Release ..
5455
55-
- name: "Build"
56+
- name: "Build package"
5657
shell: bash -l {0}
5758
run: |
5859
cd build
5960
make -j2 install
60-
make -j2 PythonInstall
61+
make -j2 PythonWrapper
62+
pip install --no-deps -e python/
6163
62-
- name: Build Documentation
64+
- name: "Build docs"
6365
shell: bash -l {0}
6466
run: |
6567
sphinx-build ./docs ./html
6668
67-
- name: Deploy documentation
69+
- name: "Deploy docs to GitHub Pages"
6870
shell: bash -l {0}
6971
run: |
7072
git reset --hard HEAD
@@ -80,7 +82,7 @@ jobs:
8082
git add -f docs/.nojekyll
8183
git commit -m "Docs from $GITHUB_REF $GITHUB_SHA" || echo "Branch is up to date"
8284
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
83-
echo "Deployment is deactivated on pull requests"
85+
echo "Deployment is deactivated in pull requests"
8486
else
8587
git push -f origin gh-pages
8688
fi

.github/workflows/Linux.yml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,48 @@ on:
1313

1414
jobs:
1515
unix:
16-
runs-on: ubuntu-20.04
17-
name: Linux (Python ${{ matrix.python-version }}, OpenMM ${{ matrix.openmm-version }}, GCC ${{ matrix.gcc-version }})
16+
runs-on: ${{ matrix.os }}
17+
name: Python ${{ matrix.python-version }}, OpenMM ${{ matrix.openmm-version }}, GCC ${{ matrix.gcc-version }}
1818
strategy:
1919
fail-fast: false
2020
matrix:
2121
include:
2222
# Oldest supported versions
23-
- python-version: "3.9"
23+
- os: ubuntu-20.04
24+
python-version: "3.9"
2425
openmm-version: "8.1"
25-
gcc-version: "9.4"
26+
gcc-version: "9"
2627

2728
# Latest supported versions
28-
- python-version: "3.11"
29+
- os: ubuntu-20.04
30+
python-version: "3.11"
2931
openmm-version: "8.1"
30-
gcc-version: "13.2"
32+
gcc-version: "13"
3133

3234
steps:
3335
- name: "Check out"
3436
uses: actions/checkout@v3
3537

36-
- name: "Update the conda enviroment file"
37-
uses: cschleiden/replace-tokens@v1
38-
with:
39-
tokenPrefix: '@'
40-
tokenSuffix: '@'
41-
files: devtools/conda-envs/build-ubuntu-20.04.yml
42-
env:
43-
GCC_VERSION: ${{ matrix.gcc-version }}
44-
OPENMM_VERSION: ${{ matrix.openmm-version }}
38+
- name: "Additional info about the build"
39+
shell: bash
40+
run: |
41+
uname -a
42+
df -h
43+
ulimit -a
4544
46-
- uses: conda-incubator/setup-miniconda@v2
47-
name: "Install dependencies with conda"
45+
- name: "Install Micromamba"
46+
uses: mamba-org/setup-micromamba@v1
4847
with:
49-
activate-environment: build
50-
environment-file: devtools/conda-envs/build-ubuntu-20.04.yml
51-
python-version: ${{ matrix.python-version }}
48+
environment-file: devtools/conda-envs/build-${{ matrix.os }}.yml
49+
environment-name: build
50+
create-args: >-
51+
python=${{ matrix.python-version }}
52+
gxx_linux-64=${{ matrix.gcc-version }}
53+
openmm=${{ matrix.openmm-version }}
5254
5355
- name: "List conda packages"
5456
shell: bash -l {0}
55-
run: conda list
57+
run: micromamba list
5658

5759
- name: "Configure"
5860
shell: bash -l {0}
@@ -69,11 +71,6 @@ jobs:
6971
make -j2 PythonWrapper
7072
pip install --no-deps -e python/
7173
72-
- name: "List plugins"
73-
shell: bash -l {0}
74-
run: |
75-
python -c "import openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')"
76-
7774
- name: "Run C++ test"
7875
shell: bash -l {0}
7976
run: |

.github/workflows/MacOS.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,47 @@ on:
1111
# Weely tests run on Sundays at 4 AM UTC (12 AM EST):
1212
- cron: "0 4 * * 0"
1313

14-
1514
jobs:
1615
unix:
1716
runs-on: ${{ matrix.os }}
18-
name: ${{ matrix.name }}
17+
name: Python ${{ matrix.python-version }}, OpenMM ${{ matrix.openmm-version }}
1918
strategy:
2019
fail-fast: false
2120
matrix:
2221
include:
23-
- name: MacOS (Python 3.9)
24-
os: macos-11
25-
gcc-version: ""
22+
# Oldest supported versions
23+
- os: macos-11
2624
python-version: "3.9"
25+
openmm-version: "8.1"
26+
27+
# Latest supported versions
28+
- os: macos-11
29+
python-version: "3.11"
30+
openmm-version: "8.1"
2731

2832
steps:
2933
- name: "Check out"
3034
uses: actions/checkout@v3
3135

32-
- name: "Install SDK on MacOS"
33-
run: source devtools/scripts/install_macos_sdk.sh
34-
35-
- name: "Update the conda enviroment file"
36-
uses: cschleiden/replace-tokens@v1
37-
with:
38-
tokenPrefix: '@'
39-
tokenSuffix: '@'
40-
files: devtools/conda-envs/build-${{ matrix.os }}.yml
41-
env:
42-
GCC_VERSION: ${{ matrix.gcc-version }}
36+
- name: "Additional info about the build"
37+
shell: bash
38+
run: |
39+
uname -a
40+
df -h
41+
ulimit -a
4342
44-
- uses: conda-incubator/setup-miniconda@v2
45-
name: "Install dependencies with conda"
43+
- name: "Install Micromamba"
44+
uses: mamba-org/setup-micromamba@v1
4645
with:
47-
activate-environment: build
4846
environment-file: devtools/conda-envs/build-${{ matrix.os }}.yml
49-
python-version: ${{ matrix.python-version }}
47+
environment-name: build
48+
create-args: >-
49+
python=${{ matrix.python-version }}
50+
openmm=${{ matrix.openmm-version }}
5051
5152
- name: "List conda packages"
5253
shell: bash -l {0}
53-
run: conda list
54+
run: micromamba list
5455

5556
- name: "Configure"
5657
shell: bash -l {0}
@@ -67,11 +68,6 @@ jobs:
6768
make -j2 PythonWrapper
6869
pip install --no-deps -e python/
6970
70-
- name: "List plugins"
71-
shell: bash -l {0}
72-
run: |
73-
python -c "import openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')"
74-
7571
- name: "Run C++ test"
7672
shell: bash -l {0}
7773
run: |

0 commit comments

Comments
 (0)