Skip to content

Commit

Permalink
do caching
Browse files Browse the repository at this point in the history
  • Loading branch information
kralka committed Feb 3, 2025
1 parent 57f668e commit 74f9412
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/piptest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,30 @@ on:

jobs:
piptesting:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
target: ppc64le
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,30 @@ jobs:
with:
python-version: '3.10'
cache: 'pip'
- name: Get pip cache directory
id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Use cached venv or create it
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.pip-cache.outputs.dir }}
# The cache key depends on requirements.txt
key: ${{ matrix.os }}-${{ matrix.platform }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.platform }}-pip-
# Build a virtualenv, but only if it doesn't already exist
- name: Populate pip cache
run: python -m pip install --require-hashes --no-deps -r requirements.txt
- name: Save cache
id: cache-save
uses: actions/cache/save@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ steps.cache.outputs.cache-primary-key }}
if: steps.cache.outputs.cache-hit != 'true'
- name: Installing test requirements and sedpack
# Start by "installing" sedpack to be sure all dependencies are listed
run: |
Expand Down

0 comments on commit 74f9412

Please sign in to comment.