diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index beecc4f1..df6bcaf2 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -9,6 +9,9 @@ on: pull_request: branches: [ "main" ] +env: + CACHE_NUMBER: 0 # increase to reset cache manually + permissions: contents: read @@ -26,6 +29,7 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.10" + - name: Create environment with mamba uses: conda-incubator/setup-miniconda@v2 with: @@ -33,7 +37,18 @@ jobs: channels: pytorch, nvidia, conda-forge auto-activate-base: false activate-environment: gfm-bench8 - environment-file: environment.yaml + + - name: Set cache date + run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV + - uses: actions/cache@v2 + with: + path: /usr/share/miniconda3/envs/my-env + key: conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} + id: cache + + - name: Update environment + run: mamba env update -n gfm-bench8 -f environment.yml + if: steps.cache.outputs.cache-hit != 'true' - name: Check solution run: |