From 89ff8571653e56f68d81a67f33dac7adce105499 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Wed, 4 Oct 2023 16:10:02 +0200 Subject: [PATCH] Devops: Use caching of `setup-python` action --- .github/workflows/cd.yml | 24 +++++------------------- .github/workflows/ci.yml | 28 +++++++--------------------- 2 files changed, 12 insertions(+), 40 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c2d0d9b..ae9b0fa 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -32,15 +32,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache Python dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: pip-pre-commit-${{ hashFiles('**/setup.json') }} - restore-keys: - pip-pre-commit- - - - name: Install Python + - name: Install Python 3.10 uses: actions/setup-python@v2 with: python-version: '3.10' @@ -69,18 +61,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache Python dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }} - restore-keys: - pip-${{ matrix.python-version }}-tests - - - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - name: Install Python + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: pyproject.toml - name: Install system dependencies run: sudo apt update && sudo apt install postgresql diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1473c16..1c3814b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,19 +11,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache Python dependencies - id: cache-pip - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: pip-pre-commit-${{ hashFiles('**/setup.json') }} - restore-keys: - pip-pre-commit- - - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.8' + cache: 'pip' + cache-dependency-path: pyproject.toml - name: Install Python dependencies run: pip install -e .[pre-commit,tests] @@ -49,19 +42,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache Python dependencies - id: cache-pip - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }} - restore-keys: - pip-${{ matrix.python-version }}-tests - - - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - name: Install Python + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: pyproject.toml - name: Install system dependencies run: sudo apt update && sudo apt install postgresql