diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 4f94ba04..d5584198 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -1,6 +1,6 @@ name: CI testing -# https://help.github.com/en/actions/reference/events-that-trigger-workflows +# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows on: # Trigger the workflow on push or pull request, # but only for the master branch @@ -60,22 +60,20 @@ jobs: python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" - - name: Cache pip - uses: actions/cache@v1 - with: - path: ~/.cache/pip # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - ${{ runner.os }}-${{ matrix.python-version }}- + # Note: This uses an internal pip API and may not always work + # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow + - name: Get pip cache + id: pip-cache + run: | + python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - - name: Cache datasets - uses: actions/cache@v1 + - name: Cache pip + - uses: actions/cache@v1 with: - path: tests/Datasets # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: mnist-dataset + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.python-version }}-pip- - name: Install dependencies run: | @@ -88,6 +86,13 @@ jobs: pip list shell: bash + - name: Cache datasets + uses: actions/cache@v1 + with: + path: tests/Datasets # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: mnist-dataset + - name: Tests # env: # TOXENV: py${{ matrix.python-version }}