Skip to content

Update actions/cache action to v6 #313

Update actions/cache action to v6

Update actions/cache action to v6 #313

Workflow file for this run

name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "trunk-minor"
- "trunk-major"
workflow_dispatch:
jobs:
execute_notebooks:
name: Execute notebooks
runs-on: ubuntu-24.04
steps:
- name: Checkout hoomd
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
path: code
ref: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
repository: glotzerlab/hoomd-blue
submodules: true
- name: Determine hoomd hash
id: hoomd
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
working-directory: code
- name: Restore cached HOOMD-blue build
id: cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: install
key: hoomd-blue-${{ steps.hoomd.outputs.sha }}-py313
- name: Checkout notebooks
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
path: notebooks
- name: Create Python Environment
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
with:
pixi-version: v0.54.1
cache: false
activate-environment: true
manifest-path: notebooks/pixi.toml
- name: Configure conda environment variables
run: |
echo "PYTHONPATH=$GITHUB_WORKSPACE/install" >> $GITHUB_ENV
- name: Configure
if: steps.cache.outputs.cache-hit != 'true'
run: >-
cmake -B hoomd/build -S code -GNinja
-DCMAKE_BUILD_TYPE=Release
-DENABLE_GPU=off
-DENABLE_MPI=on
-DBUILD_TESTING=off
-DENABLE_LLVM=off
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install
- name: Compile
if: steps.cache.outputs.cache-hit != 'true'
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: hoomd/build
- name: Cache HOOMD-blue build
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: install
key: hoomd-blue-${{ steps.hoomd.outputs.sha }}
- name: Display hoomd version
run: python3 -c "import hoomd; print(hoomd.version.version, hoomd.version.git_sha1)"
- 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 "::warning file=${file}::Has deprecation warnings" && has_warnings=1
done
exit ${has_warnings}
working-directory: notebooks