Skip to content

Commit

Permalink
fix(ci): fix the CI matrix for the latest macos image release (#2847)
Browse files Browse the repository at this point in the history
* fix(ci): fix the CI matrix for the latest macos image release

Signed-off-by: Frost Ming <[email protected]>

* fix matrix

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Apr 24, 2024
1 parent de9d7aa commit eca778f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 54 deletions.
86 changes: 36 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,72 +39,58 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
install-via: [pip]
arch: [x64]
include:
- python-version: "3.11"
os: ubuntu-latest
install-via: script
arch: x64
- python-version: "3.11"
os: windows-latest
- python-version: "3.8"
os: macos-13
install-via: pip
- python-version: "3.9"
os: macos-13
install-via: pip
exclude:
- python-version: "3.8"
os: macos-latest
install-via: pip
- python-version: "3.9"
os: macos-latest
install-via: pip
arch: x86
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
architecture: ${{ matrix.arch }}
- name: Set Python 3.8
uses: actions/setup-python@v4
if: matrix.python-version != '3.8'
- name: Setup Python Versions
uses: actions/setup-python@v5
with:
python-version: 3.8
architecture: ${{ matrix.arch }}
- name: Set Python 3.9
uses: actions/setup-python@v4
if: matrix.python-version != '3.9'
python-version: |
3.7
3.8
3.9
3.10
3.11
3.12
if: matrix.os != 'macos-latest'
- name: Setup Python Versions
uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: ${{ matrix.arch }}
- name: Set Python 3.10
uses: actions/setup-python@v4
if: matrix.python-version != '3.10'
with:
python-version: "3.10"
architecture: ${{ matrix.arch }}
- name: Set Python 3.11
uses: actions/setup-python@v4
if: matrix.python-version != '3.11'
with:
python-version: "3.11"
architecture: ${{ matrix.arch }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
python-version: |
3.10
3.11
3.12
if: matrix.os == 'macos-latest'
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
allow-prereleases: true
- name: Set Variables
id: set_variables
shell: bash
run: |
echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_OUTPUT
echo "PIP_CACHE=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache PIP
uses: actions/cache@v3
with:
path: ${{ steps.set_variables.outputs.PIP_CACHE }}
key: ${{ runner.os }}-pip-${{ steps.set_variables.outputs.PY }}
cache: pip

- name: Cache venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-${{ hashFiles('pdm.lock') }}
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pdm.lock') }}
restore-keys: |
venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-
venv-${{ runner.os }}-${{ matrix.python-version }}-
- name: Install current PDM via pip
if: matrix.install-via == 'pip'
run: python -m pip install -U .
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip

- name: Check prerelease
id: check_version
Expand All @@ -31,8 +32,7 @@ jobs:
- name: Build artifacts
run: |
python -m pip install build
python -m build
pipx run build
- name: Test Build
run: |
Expand Down

0 comments on commit eca778f

Please sign in to comment.