Skip to content

Commit

Permalink
CI: try to cache build env (#1312)
Browse files Browse the repository at this point in the history
* try to cache build env
* week
* timestamp
* checks

Co-authored-by: Jirka Borovec <[email protected]>
  • Loading branch information
Borda and Borda authored Nov 8, 2022
1 parent 00bb1ed commit ec5dfc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,25 @@ jobs:
python-version: ${{ matrix.python-version }}
offset: "pt"

- name: Cache Conda env
uses: actions/cache@v2
with:
path: ${{ env.CONDA }}/envs
key: ${{ runner.os }}-py${{ matrix.python-version }}-pt{{ matrix.pytorch-version }}-${{ env.TIMESTAMP }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
# Automatically reset every week
TIMESTAMP: $(/bin/date -u '+%Yw%W')
id: cache

# https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
# https://gist.github.com/mwouts/9842452d020c08faf9e84a3bba38a66f
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
miniforge-variant: Mambaforge
# miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
# miniconda-version: "4.7.12"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- {python-version: '3.10', requires: 'oldest'}
- {python-version: '3.10', os: 'windows'} # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
include:
- {python-version: '3.10', requires: 'latest', os: 'ubuntu-22.04'}
- {python-version: '3.10', requires: 'latest', os: 'macOS-12'}
- {os: 'ubuntu-22.04', python-version: '3.10'}
- {os: 'macOS-12', python-version: '3.10'}
env:
PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml
PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html
Expand Down

0 comments on commit ec5dfc8

Please sign in to comment.