From c6b779816751453c9dd0893a308e2b76f1da9d19 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Wed, 16 Aug 2023 01:36:02 -0300 Subject: [PATCH] ci: workaround for actions/setup-python#672 (#649) This PR has the objective of fixing actions/setup-python#672. Changes: 1. python 2.7 not available on GitHub latest runners 2. python 3.6 not available on GitHub ubuntu-latest runner --- .github/workflows/test-changes.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index 11f5346d..3180b070 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -27,13 +27,15 @@ jobs: fail-fast: false matrix: os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] - python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + include: + - python: '2.7' + os: "ubuntu-latest" runs-on: "${{ matrix.os }}" - env: testing: simple - + python_eol: no steps: - name: Determine what scope of testing is available on ${{ matrix.os }} if: | @@ -41,6 +43,12 @@ jobs: run: | echo 'testing=full' >> $GITHUB_ENV + - name: Determine if the python ${{ matrix.python }} is available on ${{ matrix.os }} + if: | + (matrix.python < '3.' ) || ( matrix.python == '3.6' && matrix.os == 'ubuntu-latest' ) + run: | + echo 'python_eol=yes' >> $GITHUB_ENV + - name: Checkout source code uses: actions/checkout@main @@ -51,10 +59,18 @@ jobs: sudo apt-get install -y --no-install-recommends python3-h5py - name: Set up Python ${{ matrix.python }} + if: env.python_eol == 'no' uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} + - name: Set up Python ${{ matrix.python }} discontinued on ${{ matrix.os }} + if: env.python_eol == 'yes' + uses: MatteoH2O1999/setup-python@v1 + with: + python-version: ${{ matrix.python }} + cache: pip + - name: Install test dependencies run: | python -m pip install --upgrade pip