From 9a0ea3e20be6ab60f158b92bbb4f3b7ef22cb0ac Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Thu, 22 Jun 2023 13:15:17 +0200 Subject: [PATCH] CI: run Python 2.7 tests in a container. Temporary work-around for: ##[error]The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04. --- .github/workflows/ci.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e48df47..68c7d5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,8 @@ jobs: matrix: include: - python: '2.7' - os: ubuntu-20.04 cython: cython==0.24 - python: '2.7' - os: ubuntu-20.04 - python: '3.5' os: ubuntu-20.04 cython: cython==0.24 @@ -29,13 +27,31 @@ jobs: os: ubuntu-22.04 - python: '3.12-dev' os: ubuntu-22.04 - runs-on: ${{matrix.os}} + runs-on: ${{matrix.os || 'ubuntu-latest'}} + container: ${{ (startsWith(matrix.python, '2.') && 'python:2.7') || null }} + defaults: + run: + shell: bash steps: - uses: actions/checkout@v3 + - name: set up PATH + run: | + PATH+=:~/.local/bin + echo "$PATH" >> $GITHUB_PATH - name: set up Python ${{matrix.python}} + if: ${{ ! startsWith(matrix.python, '2.') }} uses: actions/setup-python@v4 with: python-version: ${{matrix.python}} + - name: set up APT + if: ${{ startsWith(matrix.python, '2.') }} + run: | + printf 'Apt::Install-Recommends "false";\n' | tee -a /etc/apt/apt.conf + apt-get update + - name: upgrade TLS stack + if: ${{ startsWith(matrix.python, '2.') }} + run: | + apt-get install --only-upgrade -y ca-certificates libgnutls30 - name: install setuptools (if distutils is missing) run: | if ! [ -d ${{env.pythonLocation}}/lib/python*/distutils/ ]; then @@ -96,6 +112,7 @@ jobs: pip install docutils pygments private/check-rst - name: run shellcheck + if: ${{ ! startsWith(matrix.python, '2.') }} run: | shellcheck py-afl-*