Cache dependencies #129
This file contains hidden or 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
| # Preamble | |
| name: Cache dependencies | |
| on: | |
| schedule: | |
| - cron: '0 9 * * 1' # run every monday @ 9AM | |
| # enable worflow to be run manually | |
| workflow_dispatch: | |
| env: | |
| CACHE_NUMBER: 0 | |
| jobs: | |
| cache-build-dependencies: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| env: | |
| MPI: no | |
| OMP: no | |
| PHDF5: no | |
| DAGMC: no | |
| EVENT: no | |
| VECTFIT: no | |
| LIBMESH: no | |
| steps: | |
| - uses: actions/checkout@v4 | |
| ## TESTING CACHE ## | |
| # Setup conda | |
| - name: Set up conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: saltproc-env | |
| use-mamba: true | |
| - run: | | |
| conda config --env --set pip_interop_enabled True | |
| # check for existing cache | |
| - name: Set cache date | |
| run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| id: dependencies-cache | |
| with: | |
| path: | | |
| ~/endfb71_hdf5 | |
| key: depcache-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} | |
| # Install dependencies | |
| - name: Update environment | |
| run: mamba env update -n saltproc-env -f environment.yml | |
| if: steps.dependencies-cache.outputs.cache-hit != 'true' | |
| - name: Install OpenMC cross section library | |
| if: steps.dependencies-cache.outputs.cache-hit != 'true' | |
| run: $GITHUB_WORKSPACE/scripts/ci/openmc-xs.bash | |
| - name: Install SaltProc | |
| run: pip install . | |
| - name: Check packages | |
| run: conda list | |
| cache-doc-dependencies: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 |