CL: + test modified scripts with tar.gz source (#3125)

This commit is contained in:
native-api 2024-12-07 14:19:50 +03:00 committed by GitHub
parent 25e70b2c80
commit cc40a3f965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -201,3 +201,62 @@ jobs:
"bin")
assert os.path.dirname(sys.executable) == correct_dir'
fi
ubuntu_build_tar_gz:
needs: discover_modified_scripts
if: needs.discover_modified_scripts.outputs.versions != '[""]'
strategy:
fail-fast: false
matrix:
python-version: ${{fromJson(needs.discover_modified_scripts.outputs.versions)}}
os: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: |
#envvars
export PYENV_ROOT="$GITHUB_WORKSPACE"
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
echo "_PYTHON_BUILD_FORCE_SKIP_XZ=1" >> $GITHUB_PATH
- run: |
#prerequisites
sudo apt-get update -q; sudo apt-get install -yq make build-essential \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev
if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then
export PYENV_BOOTSTRAP_VERSION=pypy2.7-7
echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV
pyenv install $PYENV_BOOTSTRAP_VERSION
fi
- run: |
#build
pyenv install -v ${{ matrix.python-version }}
pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version
- run: |
#print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
python -c 'import sys; print(sys.version)'
else
python --version
python -m pip --version
fi
# Micropython doesn't support sys.executable, os.path, older versions even os
- env:
EXPECTED_PYTHON: ${{ matrix.python-version }}
run: |
#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:
import os, sys, os.path
correct_dir = os.path.join(
os.environ["PYENV_ROOT"],
"versions",
os.environ["EXPECTED_PYTHON"],
"bin")
assert os.path.dirname(sys.executable) == correct_dir'
fi