From f3b0e18c0beba06c0bc79a0e59bda883fdd01c7c Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sat, 8 Oct 2022 14:38:27 +0200 Subject: [PATCH] ci: fix pip cache issue caused by mixing python versions --- .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 5eec6f36..4b37748c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,11 +41,17 @@ env: jobs: pre-commit: runs-on: ubuntu-22.04 + + strategy: + fail-fast: false + matrix: + python_version: ["3.9"] + steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "${{ matrix.python_version }}" # There will almost never be a cache hit on the cache key when this job is # run, as it is the first of all jobs in this workflow. The subsequent @@ -54,7 +60,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: "${{ github.run_id }}" + key: "${{ github.run_id }}-${{ matrix.python_version }}" - name: "Install dependencies" run: | @@ -69,7 +75,7 @@ jobs: runs-on: ubuntu-${{ matrix.ubuntu_version }}" strategy: - fail-fast: false # Do not cancel all jobs if one fails + fail-fast: false matrix: ubuntu_version: ["22.04"] python_version: ["3.9"] @@ -102,7 +108,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: "${{ github.run_id }}" + key: "${{ github.run_id }}-${{ matrix.python_version }}" - name: "Install" run: |