-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CI to use micromamba instead of docker containers.
- Loading branch information
Showing
2 changed files
with
83 additions
and
127 deletions.
There are no files selected for viewing
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
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 |
This file was deleted.
Oops, something went wrong.