From 97c8e03fc8378271c406a4bf26f8966d47c1d362 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 17 Mar 2024 06:16:52 +0000 Subject: [PATCH] update CI to set minimum python version properly --- .github/workflows/gh-ci-cron.yaml | 45 +++++++++++++++++++------------ .github/workflows/gh-ci.yaml | 35 +++++++++++++++--------- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 1f740a8d..14c63f50 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -24,20 +24,36 @@ 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 @@ -45,13 +61,7 @@ jobs: 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 @@ -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 @@ -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/ @@ -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: diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 98343310..75aee772 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -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 @@ -40,8 +40,24 @@ 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 @@ -49,13 +65,7 @@ jobs: 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 @@ -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