Skip to content

Commit

Permalink
Stop caching cargo and pip dirs (#9128)
Browse files Browse the repository at this point in the history
They're of very limited value (I think), and they're some of the most unreliable parts of our infra.
  • Loading branch information
alex authored Jun 25, 2023
1 parent 313dd9d commit 93a6a35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
30 changes: 0 additions & 30 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,5 @@ runs:
using: "composite"

steps:
- name: Get pip cache dir
id: pip-cache
run: |
# Determine the path to our Python. It's in venv for our containers
# but just standard $PATH for setup-python pythons.
if [[ -f "/venv/bin/python" ]]; then
echo "dir=$(/venv/bin/python -m pip cache dir)" >> $GITHUB_OUTPUT
elif which python >/dev/null; then
echo "dir=$(python -m pip cache dir)" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Normalize key
id: normalized-key
run: echo "key=$(echo "${{ inputs.key }}" | tr -d ',')" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: cache
with:
path: |
${{ steps.pip-cache.outputs.dir }}
~/.cargo/registry/index/
~/.cargo/registry/cache/
${{ inputs.additional-paths }}
key: cargo-pip-${{ runner.os }}-${{ runner.arch }}-${{ steps.normalized-key.outputs.key }}-7
- name: Size of cache items
run: |
du -sh ~/.cargo/registry/index/
du -sh ~/.cargo/registry/cache/
shell: bash
if: ${{ steps.cache.outputs.cache-hit }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@8417cffc2ec64127ad83077aceaa8631f7cdc83e # v0.0.3
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
cache: pip
cache-dependency-path: ci-constraints-requirements.txt
- name: Setup rust
uses: dtolnay/rust-toolchain@1f5cdb56c8779e3efa22473ce181ff83143b172c
with:
Expand Down Expand Up @@ -245,6 +247,8 @@ jobs:
with:
python-version: ${{ matrix.PYTHON.VERSION }}
architecture: 'x64' # we force this right now so that it will install the universal2 on arm64
cache: pip
cache-dependency-path: ci-constraints-requirements.txt
- run: rustup component add llvm-tools-preview

- run: python -m pip install -c ci-constraints-requirements.txt 'nox'
Expand Down Expand Up @@ -302,6 +306,8 @@ jobs:
with:
python-version: ${{ matrix.PYTHON.VERSION }}
architecture: ${{ matrix.WINDOWS.ARCH }}
cache: pip
cache-dependency-path: ci-constraints-requirements.txt
- run: rustup component add llvm-tools-preview
- name: Cache rust and pip
uses: ./.github/actions/cache
Expand Down Expand Up @@ -374,6 +380,8 @@ jobs:
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: ${{ matrix.PYTHON }}
cache: pip
cache-dependency-path: ci-constraints-requirements.txt
- run: ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh install
- run: pip install .
env:
Expand Down Expand Up @@ -417,6 +425,8 @@ jobs:
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: '3.11'
cache: pip
cache-dependency-path: ci-constraints-requirements.txt
- run: pip install -c ci-constraints-requirements.txt coverage[toml]
if: ${{ always() }}
- name: Download coverage data
Expand Down

0 comments on commit 93a6a35

Please sign in to comment.