Skip to content

Commit

Permalink
ci: workaround for actions/setup-python#672 (#649)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
juarezr authored Aug 16, 2023
1 parent 91a85f5 commit c6b7798
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/test-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,28 @@ 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: |
(matrix.python >= '3.' ) && ( matrix.os != 'windows-latest' )
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

Expand All @@ -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
Expand Down

0 comments on commit c6b7798

Please sign in to comment.