Skip to content

Commit

Permalink
Refactor CI to use micromamba instead of docker containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 19, 2024
1 parent d1365c7 commit e042e99
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 127 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:

push:
branches:
- "trunk"
- "trunk-major"

workflow_dispatch:

schedule:
- cron: '0 18 * * 1'

jobs:
execute_notebooks:
name: Execute notebooks
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: hoomd
ref: trunk-minor
repository: glotzerlab/hoomd-blue
submodules: true

- name: Create Python Environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: test
environment-file: hoomd/.github/workflows/environments/py312-conda-lock.yml
micromamba-root-path: ${{ github.workspace }}/micromamba

- name: Configure conda environment variables
run: |
echo "PYTHONPATH=$GITHUB_WORKSPACE/hoomd/build" >> $GITHUB_ENV
echo "CONDA_PREFIX=$MAMBA_ROOT_PREFIX/envs/test" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/test" >> $GITHUB_ENV
echo "$MAMBA_ROOT_PREFIX/envs/test/bin" >> $GITHUB_PATH
- name: Configure
run: >-
cmake -B hoomd/build -S hoomd
-DCMAKE_BUILD_TYPE=Release
-DENABLE_GPU=off
-DENABLE_MPI=off
-DENABLE_TBB=off
-DBUILD_TESTING=off
-DENABLE_LLVM=off
- name: Compile
run: ninja -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: hoomd/build
- name: Display hoomd version
run: python3 -c "import hoomd; print(hoomd.version.version, hoomd.version.git_sha1)"

- name: Checkout notebooks
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: notebooks
- name: List notebooks
run: ls **/*.ipynb
working-directory: notebooks
- name: Execute notebooks
run: 'for i in */; do echo "Running notebooks in: $i" && jupyter nbconvert --execute --inplace $i/*.ipynb || exit 1; done'
working-directory: notebooks

# This check is very basic, but we don't want to use `python -W error` as it will also catch any
# warnings generated inside nbconvert and its dependencies.
- name: Check for warnings
run: |
has_warnings=0
for file in **/*.ipynb
do
grep Warning $file && echo "::error file=${file}::Has deprecation warnings" && has_warnings=1
done
exit ${has_warnings}
working-directory: notebooks
127 changes: 0 additions & 127 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit e042e99

Please sign in to comment.