Skip to content

Commit

Permalink
try cache
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Dec 1, 2024
1 parent 634456a commit 9d2bb18
Showing 1 changed file with 40 additions and 10 deletions.
50 changes: 40 additions & 10 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v4
Expand All @@ -105,21 +106,35 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: |
3.9
3.10
3.11
3.12
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: pip install poetry

- name: Cache Poetry
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
${{ runner.os }}-poetry-
# Publish the source distribution with the version that's in
# the repository, otherwise the tests will fail
- name: Compile source distribution
run: python3 -m poetry build --format=sdist
if: startsWith(matrix.os, 'ubuntu')

- name: Set up cache for cibuildwheel output
uses: actions/cache@v3
with:
path: wheelhouse
key: ${{ runner.os }}-cibuildwheel-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-cibuildwheel-${{ matrix.python-version }}-
${{ runner.os }}-cibuildwheel-
- name: Build wheels
uses: pypa/[email protected]
with:
Expand Down Expand Up @@ -224,6 +239,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v4
Expand All @@ -232,24 +248,38 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: |
3.9
3.10
3.11
3.12
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: pip install poetry

- name: Set version with RC
run: python -m poetry version "${{ env.RELEASE_CANDIDATE }}"

- name: Cache Poetry
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
${{ runner.os }}-poetry-
# Publish the source distribution with the version that's in
# the repository, otherwise the tests will fail
- name: Compile source distribution
run: python3 -m poetry build --format=sdist
if: startsWith(matrix.os, 'ubuntu')

- name: Set up cache for cibuildwheel output
uses: actions/cache@v3
with:
path: wheelhouse
key: ${{ runner.os }}-cibuildwheel-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-cibuildwheel-${{ matrix.python-version }}-
${{ runner.os }}-cibuildwheel-
- name: Build wheels
uses: pypa/[email protected]
with:
Expand Down

0 comments on commit 9d2bb18

Please sign in to comment.