Skip to content

Commit

Permalink
Make cache path a config
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Jan 8, 2024
1 parent 6c55d70 commit d2dfa44
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ jobs:
activate-environment: pdal-java
channels: conda-forge

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- 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 envs
uses: actions/cache@v3
with:
path: /usr/share/miniconda/envs/pdal-java
path: ${{ steps.cache-config.outputs.path }}
key:
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{ steps.cache-config.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: conda-cache
Expand Down Expand Up @@ -108,12 +110,19 @@ jobs:
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- 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 envs
uses: actions/cache@v3
with:
path: /usr/share/miniconda/envs/pdal-java
path: ${{ steps.cache-config.outputs.path }}
key:
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
conda-pdal-java-${{ runner.os }}--${{ runner.arch }}--${{ steps.cache-config.outputs.today }}-${{ matrix.pdal }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: 0
id: conda-cache
Expand Down

0 comments on commit d2dfa44

Please sign in to comment.