Skip to content

Commit 0ef2319

Browse files
authored
Merge 18c318d into 4f12d67
2 parents 4f12d67 + 18c318d commit 0ef2319

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.github/workflows/conda-package.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ jobs:
5555
with:
5656
fetch-depth: 0
5757

58+
- name: Define conda's package directory
59+
shell: bash -el {0}
60+
run: |
61+
echo "CONDA_PKGS_DIR=${{ runner.os == 'Linux' && '/home/runner/' || 'D:\\' }}conda_pkgs_dir" >> $GITHUB_ENV
62+
63+
- name: Cache conda packages
64+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
65+
env:
66+
CACHE_NUMBER: 2 # Increase to reset cache
67+
with:
68+
enableCrossOsArchive: 'true' # Use faster GNU tar
69+
path: ${{ env.CONDA_PKGS_DIR }}
70+
key:
71+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
72+
restore-keys: |
73+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
74+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
75+
5876
- name: Setup miniconda
5977
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
6078
with:
@@ -63,6 +81,7 @@ jobs:
6381
channels: conda-forge
6482
python-version: ${{ matrix.python }}
6583
activate-environment: 'build'
84+
pkgs-dirs: ${{ env.CONDA_PKGS_DIR }}
6685

6786
# Here is an issue in conda gh-12356 causing adding defaults to the list of channels
6887
# upon running `conda config --append channels conda-forge`, while mamba requires to have only conda-forge channel
@@ -84,18 +103,6 @@ jobs:
84103
- name: Install conda-build
85104
run: mamba install conda-build=${{ env.CONDA_BUILD_VERSION}}
86105

87-
- name: Cache conda packages
88-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
89-
env:
90-
CACHE_NUMBER: 1 # Increase to reset cache
91-
with:
92-
path: ${{ runner.os == 'Linux' && '/home/runner/conda_pkgs_dir' || 'C:\Users\runneradmin\conda_pkgs_dir' }}
93-
key:
94-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
95-
restore-keys: |
96-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
97-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
98-
99106
- name: Build conda package
100107
run: conda build --no-test --python ${{ matrix.python }} --numpy 2.0 ${{ env.CHANNELS }} conda-recipe
101108
env:

0 commit comments

Comments
 (0)