Skip to content

Commit f81ac72

Browse files
authored
Cache Conda env (#47454)
* Cache Conda env * python-version -> extra-specs * python-version -> extra-specs * Remove old broken conda caching * Add cache-downloads: true * Undo debug change
1 parent 4bb1fd5 commit f81ac72

File tree

6 files changed

+13
-40
lines changed

6 files changed

+13
-40
lines changed

.github/actions/build_pandas/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ runs:
66

77
- name: Environment Detail
88
run: |
9-
conda info
10-
conda list
9+
micromamba info
10+
micromamba list
1111
shell: bash -el {0}
1212

1313
- name: Build Pandas

.github/actions/setup-conda/action.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ inputs:
66
environment-name:
77
description: Name to use for the Conda environment
88
default: test
9-
python-version:
10-
description: Python version to install
9+
extra-specs:
10+
description: Extra packages to install
1111
required: false
1212
pyarrow-version:
1313
description: If set, overrides the PyArrow version in the Conda environment to the given string.
@@ -24,14 +24,13 @@ runs:
2424
if: ${{ inputs.pyarrow-version }}
2525

2626
- name: Install ${{ inputs.environment-file }}
27-
uses: conda-incubator/setup-miniconda@v2.1.1
27+
uses: mamba-org/provision-with-micromamba@v12
2828
with:
2929
environment-file: ${{ inputs.environment-file }}
30-
activate-environment: ${{ inputs.environment-name }}
31-
python-version: ${{ inputs.python-version }}
32-
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
30+
environment-name: ${{ inputs.environment-name }}
31+
extra-specs: ${{ inputs.extra-specs }}
3332
channels: conda-forge
34-
mamba-version: "0.24"
35-
use-mamba: true
36-
use-only-tar-bz2: true
33+
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
3734
condarc-file: ci/condarc.yml
35+
cache-env: true
36+
cache-downloads: true

.github/workflows/asv-bot.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ jobs:
3333
with:
3434
fetch-depth: 0
3535

36-
- name: Cache conda
37-
uses: actions/cache@v3
38-
with:
39-
path: ~/conda_pkgs_dir
40-
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
41-
4236
# Although asv sets up its own env, deps are still needed
4337
# during discovery process
4438
- name: Set up Conda

.github/workflows/code-checks.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ jobs:
5252
with:
5353
fetch-depth: 0
5454

55-
- name: Cache conda
56-
uses: actions/cache@v3
57-
with:
58-
path: ~/conda_pkgs_dir
59-
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
60-
6155
- name: Set up Conda
6256
uses: ./.github/actions/setup-conda
6357

@@ -117,12 +111,6 @@ jobs:
117111
with:
118112
fetch-depth: 0
119113

120-
- name: Cache conda
121-
uses: actions/cache@v3
122-
with:
123-
path: ~/conda_pkgs_dir
124-
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
125-
126114
- name: Set up Conda
127115
uses: ./.github/actions/setup-conda
128116

.github/workflows/sdist.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ jobs:
6262
- name: Set up Conda
6363
uses: ./.github/actions/setup-conda
6464
with:
65-
environment-file: ""
65+
environment-file: false
6666
environment-name: pandas-sdist
67-
python-version: ${{ matrix.python-version }}
67+
extra-specs: |
68+
python =${{ matrix.python-version }}
6869
6970
- name: Install pandas from sdist
7071
run: |

.github/workflows/ubuntu.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,6 @@ jobs:
134134
with:
135135
fetch-depth: 0
136136

137-
- name: Cache conda
138-
uses: actions/cache@v3
139-
env:
140-
CACHE_NUMBER: 0
141-
with:
142-
path: ~/conda_pkgs_dir
143-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
144-
hashFiles('${{ env.ENV_FILE }}') }}
145-
146137
- name: Extra installs
147138
# xsel for clipboard tests
148139
run: sudo apt-get update && sudo apt-get install -y xsel ${{ env.EXTRA_APT }}

0 commit comments

Comments
 (0)