Skip to content

Commit 70cd65f

Browse files
committed
improve conda env install and caching
1 parent 7329d22 commit 70cd65f

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.github/workflows/build.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ jobs:
119119
- uses: conda-incubator/setup-miniconda@v3
120120
with:
121121
auto-update-conda: true
122-
auto-activate-base: true
123122
activate-environment: ${{steps.setup.outputs.env-name}}
124123
channel-priority: strict
125124
miniforge-version: latest
@@ -132,43 +131,38 @@ jobs:
132131
- name: Restore cached env
133132
uses: actions/cache/restore@v4
134133
with:
135-
path: ${{env.CONDA}}/envs/${{steps.setup.outputs.env-name}}
134+
path: ${{env.CONDA}}/envs
136135
key: >-
137136
conda-${{runner.os}}-${{runner.arch}}
138137
-${{steps.get-date.outputs.today}}
139138
-${{hashFiles(steps.setup.outputs.env-file)}}
140139
-${{env.CACHE_NUMBER}}
141140
env:
142-
CACHE_NUMBER: 0
141+
CACHE_NUMBER: 1
143142
id: cache-env
144143
- name: Install env
145144
if: steps.cache-env.outputs.cache-hit != 'true'
146145
run: |
147146
conda env update --name=${{steps.setup.outputs.env-name}} --file=${{steps.setup.outputs.env-file}}
148147
- name: Ensure Python/numpy version
149-
# if: steps.cache-env.outputs.cache-hit != 'true' # TODO: skip this step on cache hits once the caches are all updated
148+
if: steps.cache-env.outputs.cache-hit != 'true'
150149
run: |
151150
conda install python=${{matrix.python-version}} numpy=${{matrix.numpy-version}}
152-
- name: Install uncached pip dependencies
153-
run: |
154-
pip install --upgrade pip
155-
pip install --no-deps -e .
156-
- name: Install uncached pip dependencies for 'full' environment
157-
if: matrix.conda-env == 'full'
158-
run: |
159-
pip install git+https://github.com/ChaoningZhang/MobileSAM.git
160151
- name: Cache env
161152
if: steps.cache-env.outputs.cache-hit != 'true'
162153
uses: actions/cache/save@v4
163154
with:
164-
path: ${{env.CONDA}}/envs/${{steps.setup.outputs.env-name}}
155+
path: ${{env.CONDA}}/envs
165156
key: >-
166157
conda-${{runner.os}}-${{runner.arch}}
167158
-${{steps.get-date.outputs.today}}
168159
-${{hashFiles(steps.setup.outputs.env-file)}}
169160
-${{env.CACHE_NUMBER}}
170161
env:
171-
CACHE_NUMBER: 0
162+
CACHE_NUMBER: 1
163+
- name: Force reinstall of developed package
164+
run: |
165+
pip install --upgrade --no-deps --force-reinstall -e .
172166
- run: conda list
173167
- name: Pyright
174168
if: matrix.run-expensive-tests

0 commit comments

Comments
 (0)