From 410095e129924fb221db138865383cb8c5c92fc6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 30 Jun 2020 22:26:41 +0300 Subject: [PATCH] Use new 'pip cache dir' to combine macOS/Ubuntu cache config --- .github/workflows/test.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb31ff997..d65f14c11 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,31 +36,25 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Ubuntu cache - uses: actions/cache@v2 - if: startsWith(matrix.os, 'ubuntu') - with: - path: ~/.cache/pip - key: - ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.ci/*.sh') }} - restore-keys: | - ${{ matrix.os }}-${{ matrix.python-version }}- - - - name: macOS cache - uses: actions/cache@v2 - if: startsWith(matrix.os, 'macOS') - with: - path: ~/Library/Caches/pip - key: - ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.ci/*.sh') }} - restore-keys: | - ${{ matrix.os }}-${{ matrix.python-version }}- - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: pip cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: + ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.ci/*.sh') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}- + - name: Build system information run: python .github/workflows/system-info.py