diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 2555c21a57..c70956376b 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -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 @@ -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/cibuildwheel@v2.22.0 with: @@ -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 @@ -232,11 +248,7 @@ 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 @@ -244,12 +256,30 @@ jobs: - 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/cibuildwheel@v2.22.0 with: