Skip to content

Commit

Permalink
update CI to set minimum python version properly
Browse files Browse the repository at this point in the history
  • Loading branch information
IAlibay committed Mar 17, 2024
1 parent f733658 commit 97c8e03
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 29 deletions.
45 changes: 28 additions & 17 deletions .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,44 @@ jobs:
outputs:
matrix: ${{ steps.get-mdakits.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- id: get-python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.12"

- id: get-mdakits
run: |
mdakit=$(python utils/get_dir_matrix.py)
echo "matrix=${mdakit}" >> $GITHUB_OUTPUT
env_config:
runs-on: ubuntu-latest
outputs:
python-stable: {{ "${{ steps.get-compatible-python.outputs.stable-python }}" }}
python-min: {{ "${{ steps.get-compatible-python.outputs.oldest-pythons }}" }}

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.12"

- id: get-compatible-python
uses: MDAnalysis/mdanalysis-compatible-python@main
with:
release: "develop"

mdakit-ci:
needs: gen_matrix
needs: [gen_matrix, env_config]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mdakit: ${{fromJSON(needs.gen_matrix.outputs.matrix)}}
jobstep: ['latest', 'develop']
steps:
- uses: actions/checkout@v3

- id: prev-python-ver
name: prev-python-ver
uses: MDAnalysis/get-latest-python-version@main
with:
last-n-minor-release: 1
- uses: actions/checkout@v4

- id: get-base-python-deps
name: get-base-python-deps
Expand All @@ -60,10 +70,11 @@ jobs:
- id: check-set-python-bounds
name: check-set-python-bounds
continue-on-error: true
continue-on-error: false
run: |
basepy=${{steps.prev-python-ver.outputs.python-version}}
pyver=$(python utils/check_python_ver.py --mdakit "${{matrix.mdakit}}" --maxpyver ${basepy})
maxpy=${{needs.env_config.outputs.python-stable}}
minpy=${{needs.env_config.outputs.python-min}}
pyver=$(python utils/check_python_ver.py --mdakit "${{matrix.mdakit}}" --maxpyver ${maxpy} --minpyver ${minpy})
echo "PYVER=${pyver}" >> $GITHUB_ENV
- id: install-conda-env
Expand Down Expand Up @@ -159,9 +170,9 @@ jobs:
packages: none
issues: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: json-statuses/

Expand Down Expand Up @@ -191,7 +202,7 @@ jobs:
needs: process_results
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup_micromamba
uses: mamba-org/setup-micromamba@v1
with:
Expand Down
35 changes: 23 additions & 12 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
outputs:
matrix: ${{ steps.get-changed-mdakits.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- id: get-python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9

Expand All @@ -40,22 +40,32 @@ jobs:
echo ${mdakit}
echo "matrix=${mdakit}" >> $GITHUB_OUTPUT
env_config:
runs-on: ubuntu-latest
outputs:
python-stable: {{ "${{ steps.get-compatible-python.outputs.stable-python }}" }}
python-min: {{ "${{ steps.get-compatible-python.outputs.oldest-pythons }}" }}

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.12"

- id: get-compatible-python
uses: MDAnalysis/mdanalysis-compatible-python@main
with:
release: "develop"

mdakit-ci:
needs: gen_matrix
needs: [gen_matrix, env_config]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mdakit: ${{fromJSON(needs.gen_matrix.outputs.matrix)}}
jobstep: ['latest', 'develop']
steps:
- uses: actions/checkout@v3

- id: prev-python-ver
name: prev-python-ver
uses: MDAnalysis/get-latest-python-version@main
with:
last-n-minor-release: 1
- uses: actions/checkout@v4

- id: get-base-python-deps
name: get-base-python-deps
Expand All @@ -66,8 +76,9 @@ jobs:
name: check-set-python-bounds
continue-on-error: false
run: |
basepy=${{steps.prev-python-ver.outputs.python-version}}
pyver=$(python utils/check_python_ver.py --mdakit "${{matrix.mdakit}}" --maxpyver ${basepy})
maxpy=${{needs.env_config.outputs.python-stable}}
minpy=${{needs.env_config.outputs.python-min}}
pyver=$(python utils/check_python_ver.py --mdakit "${{matrix.mdakit}}" --maxpyver ${maxpy} --minpyver ${minpy})
echo "PYVER=${pyver}" >> $GITHUB_ENV
- id: install-conda-env
Expand Down

0 comments on commit 97c8e03

Please sign in to comment.