From 45497c33b893212d71c1dfed3874e0868ff23050 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 17 Nov 2019 13:24:37 +0200 Subject: [PATCH] Add hashFiles to cache key, and add restore-keys --- .github/workflows/test.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9288553d9..68d2731bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,18 +31,24 @@ jobs: - uses: actions/checkout@v1 - name: Ubuntu cache - uses: actions/cache@preview + uses: actions/cache@v1 if: startsWith(matrix.os, 'ubuntu') with: path: ~/.cache/pip - key: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.python-version }} + key: + ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.travis/*.sh') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}- - name: macOS cache - uses: actions/cache@preview + uses: actions/cache@v1 if: startsWith(matrix.os, 'macOS') with: path: ~/Library/Caches/pip - key: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.python-version }} + key: + ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.travis/*.sh') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}- - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1