From 49cc88094a5378f6761286562dc44c00caec623a Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 10 Dec 2022 15:48:28 +0300 Subject: [PATCH] CI: Install bootstrapper Python for PyPy source builds --- .github/workflows/modified_scripts_build.yml | 40 ++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/modified_scripts_build.yml b/.github/workflows/modified_scripts_build.yml index 56c79065..37cff845 100644 --- a/.github/workflows/modified_scripts_build.yml +++ b/.github/workflows/modified_scripts_build.yml @@ -32,26 +32,35 @@ jobs: steps: - uses: actions/checkout@v2 - run: | - brew install openssl openssl@1.1 readline sqlite3 xz zlib - - run: | + #envvars export PYENV_ROOT="$GITHUB_WORKSPACE" echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH - 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 global ${{ matrix.python-version }} # Micropython doesn't support --version - - run: > + - run: | + #print version if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then python -c 'import sys; print(sys.version)' else - python --version; + 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"' @@ -82,29 +91,38 @@ jobs: steps: - uses: actions/checkout@v2 - run: | - 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 - - run: | + #envvars export PYENV_ROOT="$GITHUB_WORKSPACE" echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $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 + 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 global ${{ matrix.python-version }} # Micropython doesn't support --version - - run: > + - run: | + #print version if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then python -c 'import sys; print(sys.version)' else - python --version; + 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"'