Skip to content

Commit

Permalink
Cache Conda in CI (#74)
Browse files Browse the repository at this point in the history
* Cache Conda in actions

* Cache hit check

* Make cache path a config
  • Loading branch information
pomadchin authored Jan 8, 2024
1 parent 8752273 commit 35470b6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 664 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,25 @@ jobs:
activate-environment: pdal-java
channels: conda-forge

- name: Conda cache config
id: cache-config
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
echo "path=$CONDA/envs/pdal-java" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ steps.cache-config.outputs.path }}
key:
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{ steps.cache-config.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: conda-cache

- name: Install PDAL
if: steps.conda-cache.outputs.cache-hit != 'true'
run: conda install pdal=${{ matrix.pdal }}

- name: Set LD_LIBRARY_PATH
Expand Down Expand Up @@ -87,7 +105,25 @@ jobs:
activate-environment: pdal-java
channels: conda-forge

- name: Conda cache config
id: cache-config
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
echo "path=$CONDA/envs/pdal-java" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ steps.cache-config.outputs.path }}
key:
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{ steps.cache-config.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: conda-cache

- name: Install PDAL
if: steps.conda-cache.outputs.cache-hit != 'true'
run: conda install pdal=${{ matrix.pdal }}

- name: Set LD_LIBRARY_PATH
Expand Down
Loading

0 comments on commit 35470b6

Please sign in to comment.