Skip to content

Commit

Permalink
Cache Conda env (#47454)
Browse files Browse the repository at this point in the history
* Cache Conda env

* python-version -> extra-specs

* python-version -> extra-specs

* Remove old broken conda caching

* Add cache-downloads: true

* Undo debug change
  • Loading branch information
jonashaag committed Jun 27, 2022
1 parent 4bb1fd5 commit f81ac72
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build_pandas/action.yml
Expand Up @@ -6,8 +6,8 @@ runs:

- name: Environment Detail
run: |
conda info
conda list
micromamba info
micromamba list
shell: bash -el {0}

- name: Build Pandas
Expand Down
17 changes: 8 additions & 9 deletions .github/actions/setup-conda/action.yml
Expand Up @@ -6,8 +6,8 @@ inputs:
environment-name:
description: Name to use for the Conda environment
default: test
python-version:
description: Python version to install
extra-specs:
description: Extra packages to install
required: false
pyarrow-version:
description: If set, overrides the PyArrow version in the Conda environment to the given string.
Expand All @@ -24,14 +24,13 @@ runs:
if: ${{ inputs.pyarrow-version }}

- name: Install ${{ inputs.environment-file }}
uses: conda-incubator/setup-miniconda@v2.1.1
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ${{ inputs.environment-file }}
activate-environment: ${{ inputs.environment-name }}
python-version: ${{ inputs.python-version }}
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
environment-name: ${{ inputs.environment-name }}
extra-specs: ${{ inputs.extra-specs }}
channels: conda-forge
mamba-version: "0.24"
use-mamba: true
use-only-tar-bz2: true
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
condarc-file: ci/condarc.yml
cache-env: true
cache-downloads: true
6 changes: 0 additions & 6 deletions .github/workflows/asv-bot.yml
Expand Up @@ -33,12 +33,6 @@ jobs:
with:
fetch-depth: 0

- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}

# Although asv sets up its own env, deps are still needed
# during discovery process
- name: Set up Conda
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/code-checks.yml
Expand Up @@ -52,12 +52,6 @@ jobs:
with:
fetch-depth: 0

- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}

- name: Set up Conda
uses: ./.github/actions/setup-conda

Expand Down Expand Up @@ -117,12 +111,6 @@ jobs:
with:
fetch-depth: 0

- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}

- name: Set up Conda
uses: ./.github/actions/setup-conda

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/sdist.yml
Expand Up @@ -62,9 +62,10 @@ jobs:
- name: Set up Conda
uses: ./.github/actions/setup-conda
with:
environment-file: ""
environment-file: false
environment-name: pandas-sdist
python-version: ${{ matrix.python-version }}
extra-specs: |
python =${{ matrix.python-version }}
- name: Install pandas from sdist
run: |
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ubuntu.yml
Expand Up @@ -134,15 +134,6 @@ jobs:
with:
fetch-depth: 0

- name: Cache conda
uses: actions/cache@v3
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('${{ env.ENV_FILE }}') }}

- name: Extra installs
# xsel for clipboard tests
run: sudo apt-get update && sudo apt-get install -y xsel ${{ env.EXTRA_APT }}
Expand Down

0 comments on commit f81ac72

Please sign in to comment.