CI: Install bootstrapper Python for PyPy source builds

This commit is contained in:
Ivan Pozdeev 2022-12-10 15:48:28 +03:00
parent cad18bb332
commit 49cc88094a

View file

@ -32,26 +32,35 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: | - run: |
brew install openssl openssl@1.1 readline sqlite3 xz zlib #envvars
- run: |
export PYENV_ROOT="$GITHUB_WORKSPACE" export PYENV_ROOT="$GITHUB_WORKSPACE"
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
- run: | - run: |
#prerequisites
brew install openssl openssl@1.1 readline sqlite3 xz zlib
if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then
pyenv install 2.7.18
PYENV_VERSION=2.7.18 pip install curses genc pycparser
fi
- run: |
#build
pyenv install -v ${{ matrix.python-version }} pyenv install -v ${{ matrix.python-version }}
pyenv global ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version # Micropython doesn't support --version
- run: > - run: |
#print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
python -c 'import sys; print(sys.version)' python -c 'import sys; print(sys.version)'
else else
python --version; python --version
python -m pip --version python -m pip --version
fi fi
# Micropython doesn't support sys.executable, os.path, older versions even os # 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
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1 [[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
python -c 'import sys; assert sys.implementation.name == "micropython"' python -c 'import sys; assert sys.implementation.name == "micropython"'
@ -82,29 +91,38 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: | - run: |
sudo apt-get update -q; sudo apt-get install -yq make build-essential \ #envvars
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev
- run: |
export PYENV_ROOT="$GITHUB_WORKSPACE" export PYENV_ROOT="$GITHUB_WORKSPACE"
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
- run: | - 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
pyenv install 2.7.18
PYENV_VERSION=2.7.18 pip install curses genc pycparser
fi
- run: |
#build
pyenv install -v ${{ matrix.python-version }} pyenv install -v ${{ matrix.python-version }}
pyenv global ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version # Micropython doesn't support --version
- run: > - run: |
#print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
python -c 'import sys; print(sys.version)' python -c 'import sys; print(sys.version)'
else else
python --version; python --version
python -m pip --version python -m pip --version
fi fi
# Micropython doesn't support sys.executable, os.path, older versions even os # 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
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1 [[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
python -c 'import sys; assert sys.implementation.name == "micropython"' python -c 'import sys; assert sys.implementation.name == "micropython"'