Merge pull request #3372 from native-api/ci_update_cleanup

CI: Update and cleanup workflow scripts
This commit is contained in:
native-api 2025-12-20 19:37:04 +03:00 committed by GitHub
commit 5855d9dfca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 67 deletions

View File

@ -10,19 +10,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: python-version:
- "3.9"
- "3.10" - "3.10"
- "3.11" - "3.11"
- "3.12" - "3.12"
- "3.13" - "3.13"
- "3.14"
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
# Normally, we would use the superbly maintained...
# - uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# ... but in the repo, we want to test pyenv builds on macOS
- run: | - run: |
brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd
# https://github.com/pyenv/pyenv#installation # https://github.com/pyenv/pyenv#installation

View File

@ -121,24 +121,14 @@ jobs:
pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$? pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$?
if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi
pyenv global ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version
- run: | - run: |
#print version #print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
python -c 'import sys; print(sys.version)'
else
python --version python --version
python -m pip --version python -m pip --version
fi
# Micropython doesn't support sys.executable, os.path, older versions even os
- env: - env:
EXPECTED_PYTHON: ${{ matrix.python-version }} EXPECTED_PYTHON: ${{ matrix.python-version }}
run: | run: |
#check #check
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
python -c 'import sys; assert sys.implementation.name == "micropython"'
else
python -c 'if True: python -c 'if True:
import os, sys, os.path import os, sys, os.path
correct_dir = os.path.join( correct_dir = os.path.join(
@ -147,7 +137,6 @@ jobs:
os.environ["EXPECTED_PYTHON"], os.environ["EXPECTED_PYTHON"],
"bin") "bin")
assert os.path.dirname(sys.executable) == correct_dir' assert os.path.dirname(sys.executable) == correct_dir'
fi
# bundled executables in some Anaconda releases cause the post-run step to hang in MacOS # bundled executables in some Anaconda releases cause the post-run step to hang in MacOS
- run: | - run: |
pyenv global system pyenv global system
@ -245,24 +234,14 @@ jobs:
pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$? pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$?
if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi
pyenv global ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version
- run: | - run: |
#print version #print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
python -c 'import sys; print(sys.version)'
else
python --version python --version
python -m pip --version python -m pip --version
fi
# Micropython doesn't support sys.executable, os.path, older versions even os
- env: - env:
EXPECTED_PYTHON: ${{ matrix.python-version }} EXPECTED_PYTHON: ${{ matrix.python-version }}
run: | run: |
#check #check
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
python -c 'import sys; assert sys.implementation.name == "micropython"'
else
python -c 'if True: python -c 'if True:
import os, sys, os.path import os, sys, os.path
correct_dir = os.path.join( correct_dir = os.path.join(
@ -271,4 +250,3 @@ jobs:
os.environ["EXPECTED_PYTHON"], os.environ["EXPECTED_PYTHON"],
"bin") "bin")
assert os.path.dirname(sys.executable) == correct_dir' assert os.path.dirname(sys.executable) == correct_dir'
fi

View File

@ -13,26 +13,14 @@ jobs:
- ubuntu-24.04 - ubuntu-24.04
- ubuntu-22.04 - ubuntu-22.04
- macos-15-intel - macos-15-intel
- macos-15
- macos-14 - macos-14
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
# Normally, we would use the superbly maintained...
# - uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# ... but in the repo, we want to test pyenv builds on Ubuntu
# - run: |
# sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
# libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
# xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
# https://github.com/pyenv/pyenv#installation
- run: | - run: |
if test "$RUNNER_OS" == "macOS"; then if test "$RUNNER_OS" == "macOS"; then
brew install coreutils fish brew install coreutils fish
elif [[ $(lsb_release -sr | awk -F. '{print $1}') -ge 20 ]]; then
# Ubuntu 18 has fish 2 which lacks many features that facilitate testing
sudo apt install fish -yq
fi fi
- run: pwd - run: pwd
- env: - env:

View File

@ -10,19 +10,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: python-version:
- "3.9"
- "3.10" - "3.10"
- "3.11" - "3.11"
- "3.12" - "3.12"
- "3.13" - "3.13"
- "3.14"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
# Normally, we would use the superbly maintained...
# - uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# ... but in the repo, we want to test pyenv builds on Ubuntu
- run: | - run: |
sudo apt-get update -q; sudo apt install -yq make build-essential libssl-dev zlib1g-dev \ sudo apt-get update -q; sudo apt install -yq make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \ libbz2-dev libreadline-dev libsqlite3-dev curl \