|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 |
|
13 | | - create-conda-env-cache-if-missing: |
14 | | - name: Caching conda env |
15 | | - runs-on: "ubuntu-latest" |
16 | | - strategy: |
17 | | - fail-fast: true |
18 | | - defaults: |
19 | | - # by default run in bash mode (required for conda usage) |
20 | | - run: |
21 | | - shell: bash -l {0} |
22 | | - steps: |
23 | | - - uses: actions/checkout@v3 |
24 | | - |
25 | | - - name: Get current year-month |
26 | | - id: date |
27 | | - run: | |
28 | | - echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT |
29 | | -
|
30 | | - - name: Get current dependencies hash |
31 | | - id: dependencies |
32 | | - run: | |
33 | | - echo "hash=${{hashFiles('**/pyproject.toml', '**/environment_testing.yml')}}" >> $GITHUB_OUTPUT |
34 | | -
|
35 | | - - uses: actions/cache@v3 |
36 | | - # the cache for python package is reset: |
37 | | - # * every month |
38 | | - # * when package dependencies change |
39 | | - id: cache-conda-env |
40 | | - with: |
41 | | - path: /usr/share/miniconda/envs/neo-test-env |
42 | | - key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }} |
43 | | - |
44 | | - - name: Cache found? |
45 | | - run: echo "Cache-hit == ${{steps.cache-conda-env.outputs.cache-hit == 'true'}}" |
46 | | - |
47 | | - # activate environment if not restored from cache |
48 | | - - uses: conda-incubator/[email protected] |
49 | | - if: steps.cache-conda-env.outputs.cache-hit != 'true' |
50 | | - with: |
51 | | - activate-environment: neo-test-env |
52 | | - environment-file: environment_testing.yml |
53 | | - python-version: 3.9 |
54 | | - |
55 | | - - name: Create the conda environment to be cached |
56 | | - if: steps.cache-conda-env.outputs.cache-hit != 'true' |
57 | | - # create conda env, configure git and install pip, neo and test dependencies from master |
58 | | - # for PRs that change dependencies, this environment will be updated in the test workflow |
59 | | - run: | |
60 | | - git config --global user.email "neo_ci@fake_mail.com" |
61 | | - git config --global user.name "neo CI" |
62 | | - python -m pip install -U pip # Official recommended way |
63 | | - pip install --upgrade -e .[test] |
| 13 | + # create-conda-env-cache-if-missing: |
| 14 | + # name: Caching conda env |
| 15 | + # runs-on: "ubuntu-latest" |
| 16 | + # strategy: |
| 17 | + # fail-fast: true |
| 18 | + # defaults: |
| 19 | + # # by default run in bash mode (required for conda usage) |
| 20 | + # run: |
| 21 | + # shell: bash -l {0} |
| 22 | + # steps: |
| 23 | + # - uses: actions/checkout@v3 |
| 24 | + |
| 25 | + # - name: Get current year-month |
| 26 | + # id: date |
| 27 | + # run: | |
| 28 | + # echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT |
| 29 | + |
| 30 | + # - name: Get current dependencies hash |
| 31 | + # id: dependencies |
| 32 | + # run: | |
| 33 | + # echo "hash=${{hashFiles('**/pyproject.toml', '**/environment_testing.yml')}}" >> $GITHUB_OUTPUT |
| 34 | + |
| 35 | + # - uses: actions/cache@v3 |
| 36 | + # # the cache for python package is reset: |
| 37 | + # # * every month |
| 38 | + # # * when package dependencies change |
| 39 | + # id: cache-conda-env |
| 40 | + # with: |
| 41 | + # path: /usr/share/miniconda/envs/neo-test-env |
| 42 | + # key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }} |
| 43 | + |
| 44 | + # - name: Cache found? |
| 45 | + # run: echo "Cache-hit == ${{steps.cache-conda-env.outputs.cache-hit == 'true'}}" |
| 46 | + |
| 47 | + # # activate environment if not restored from cache |
| 48 | + # - uses: conda-incubator/[email protected] |
| 49 | + # if: steps.cache-conda-env.outputs.cache-hit != 'true' |
| 50 | + # with: |
| 51 | + # activate-environment: neo-test-env |
| 52 | + # environment-file: environment_testing.yml |
| 53 | + # python-version: 3.9 |
| 54 | + |
| 55 | + # - name: Create the conda environment to be cached |
| 56 | + # if: steps.cache-conda-env.outputs.cache-hit != 'true' |
| 57 | + # # create conda env, configure git and install pip, neo and test dependencies from master |
| 58 | + # # for PRs that change dependencies, this environment will be updated in the test workflow |
| 59 | + # run: | |
| 60 | + # git config --global user.email "neo_ci@fake_mail.com" |
| 61 | + # git config --global user.name "neo CI" |
| 62 | + # python -m pip install -U pip # Official recommended way |
| 63 | + # pip install --upgrade -e .[test] |
64 | 64 |
|
65 | 65 | create-data-cache-if-missing: |
66 | 66 | name: Caching data env |
|
0 commit comments