|
5 | 5 | # https://autobencoder.com/2020-08-24-conda-actions/ |
6 | 6 |
|
7 | 7 |
|
8 | | -name: Conda Test |
| 8 | +# name: Conda Test |
9 | 9 |
|
10 | | -on: |
11 | | - push: |
12 | | - branches: [ main ] |
13 | | - pull_request: |
14 | | - branches: [ '*' ] |
| 10 | +# on: |
| 11 | +# push: |
| 12 | +# branches: [ main ] |
| 13 | +# pull_request: |
| 14 | +# branches: [ '*' ] |
15 | 15 |
|
16 | | -jobs: |
17 | | - build: |
18 | | - runs-on: ubuntu-latest |
19 | | - # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell |
20 | | - defaults: |
21 | | - run: |
22 | | - shell: bash -l {0} |
23 | | - steps: |
24 | | - - uses: actions/checkout@v3 |
25 | | - with: |
26 | | - submodules: recursive |
27 | | - # Cache to save build time |
28 | | - # https://github.com/marketplace/actions/setup-miniconda#caching |
29 | | - - name: Cache conda |
30 | | - uses: actions/cache@v2 |
31 | | - env: |
32 | | - # Increase this value to reset cache if etc/example-environment.yml has not changed |
33 | | - CACHE_NUMBER: 0 |
34 | | - with: |
35 | | - path: ~/conda_pkgs_dir |
36 | | - key: |
37 | | - ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ |
38 | | - hashFiles('environment.yml') }} |
39 | | - - uses: conda-incubator/setup-miniconda@v2 |
40 | | - with: |
41 | | - activate-environment: anaconda-client-env |
42 | | - channel-priority: strict |
43 | | - environment-file: environment.yml |
44 | | - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly |
45 | | - # setup a Miniconda variant without specifying a environment file |
46 | | - - name: Setup Mambaforge |
47 | | - uses: conda-incubator/setup-miniconda@v2 |
48 | | - with: |
49 | | - miniforge-variant: Mambaforge |
50 | | - miniforge-version: latest |
51 | | - activate-environment: anaconda-client-env |
52 | | - use-mamba: true |
53 | | - - name: Install Extra Python dependencies |
54 | | - run: | |
55 | | - conda activate anaconda-client-env |
56 | | - mamba install --name anaconda-client-env pytest |
57 | | - - name: Set Python Path |
58 | | - run: conda env config vars set PYTHONPATH=$(pwd):$(pwd)/src |
59 | | - # refresh the cache every 24 hours to avoid inconsistencies of package versions |
60 | | - - name: Get Date |
61 | | - id: get-date |
62 | | - run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" |
63 | | - shell: bash |
64 | | - - name: Cache Conda env |
65 | | - uses: actions/cache@v2 |
66 | | - with: |
67 | | - path: ${{ env.CONDA }}/envs |
68 | | - key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }} |
69 | | - env: |
70 | | - # Increase this value to reset cache if etc/example-environment.yml has not changed |
71 | | - CACHE_NUMBER: 0 |
72 | | - id: cache |
73 | | - # Finally, update the environment based on the environment file if the cache does not exist. |
74 | | - - name: Update environment |
75 | | - run: | |
76 | | - mamba env update -n anaconda-client-env -f environment.yml |
77 | | - mamba install --name anaconda-client-env pytest |
78 | | - if: steps.cache.outputs.cache-hit != 'true' |
79 | | - - name: Test with pytest |
80 | | - run: | |
81 | | - conda activate anaconda-client-env |
82 | | - python -m pytest tests/ |
| 16 | +# jobs: |
| 17 | +# build: |
| 18 | +# runs-on: ubuntu-latest |
| 19 | +# # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell |
| 20 | +# defaults: |
| 21 | +# run: |
| 22 | +# shell: bash -l {0} |
| 23 | +# steps: |
| 24 | +# - uses: actions/checkout@v3 |
| 25 | +# with: |
| 26 | +# submodules: recursive |
| 27 | +# # Cache to save build time |
| 28 | +# # https://github.com/marketplace/actions/setup-miniconda#caching |
| 29 | +# - name: Cache conda |
| 30 | +# uses: actions/cache@v2 |
| 31 | +# env: |
| 32 | +# # Increase this value to reset cache if etc/example-environment.yml has not changed |
| 33 | +# CACHE_NUMBER: 0 |
| 34 | +# with: |
| 35 | +# path: ~/conda_pkgs_dir |
| 36 | +# key: |
| 37 | +# ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ |
| 38 | +# hashFiles('environment.yml') }} |
| 39 | +# - uses: conda-incubator/setup-miniconda@v2 |
| 40 | +# with: |
| 41 | +# activate-environment: anaconda-client-env |
| 42 | +# channel-priority: strict |
| 43 | +# environment-file: environment.yml |
| 44 | +# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly |
| 45 | +# # setup a Miniconda variant without specifying a environment file |
| 46 | +# - name: Setup Mambaforge |
| 47 | +# uses: conda-incubator/setup-miniconda@v2 |
| 48 | +# with: |
| 49 | +# miniforge-variant: Mambaforge |
| 50 | +# miniforge-version: latest |
| 51 | +# activate-environment: anaconda-client-env |
| 52 | +# use-mamba: true |
| 53 | +# - name: Install Extra Python dependencies |
| 54 | +# run: | |
| 55 | +# conda activate anaconda-client-env |
| 56 | +# mamba install --name anaconda-client-env pytest |
| 57 | +# - name: Set Python Path |
| 58 | +# run: conda env config vars set PYTHONPATH=$(pwd):$(pwd)/src |
| 59 | +# # refresh the cache every 24 hours to avoid inconsistencies of package versions |
| 60 | +# - name: Get Date |
| 61 | +# id: get-date |
| 62 | +# run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" |
| 63 | +# shell: bash |
| 64 | +# - name: Cache Conda env |
| 65 | +# uses: actions/cache@v2 |
| 66 | +# with: |
| 67 | +# path: ${{ env.CONDA }}/envs |
| 68 | +# key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }} |
| 69 | +# env: |
| 70 | +# # Increase this value to reset cache if etc/example-environment.yml has not changed |
| 71 | +# CACHE_NUMBER: 0 |
| 72 | +# id: cache |
| 73 | +# # Finally, update the environment based on the environment file if the cache does not exist. |
| 74 | +# - name: Update environment |
| 75 | +# run: | |
| 76 | +# mamba env update -n anaconda-client-env -f environment.yml |
| 77 | +# mamba install --name anaconda-client-env pytest |
| 78 | +# if: steps.cache.outputs.cache-hit != 'true' |
| 79 | +# - name: Test with pytest |
| 80 | +# run: | |
| 81 | +# conda activate anaconda-client-env |
| 82 | +# python -m pytest tests/ |
0 commit comments