From eb6c5395cf0d92f8ad21d089d09c58e6ccf662d7 Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Wed, 12 Feb 2025 08:20:03 +0000 Subject: [PATCH 1/3] Stop using Ubuntu Focal runners --- .github/workflows/tag-and-release.yml | 6 +++--- .github/workflows/tox.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tag-and-release.yml b/.github/workflows/tag-and-release.yml index d70718e..955e39f 100644 --- a/.github/workflows/tag-and-release.yml +++ b/.github/workflows/tag-and-release.yml @@ -9,7 +9,7 @@ name: Tag & Release required: false jobs: turnstyle: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Serialise runs of this workflow permissions: actions: read @@ -28,7 +28,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: naming-things-is-hard-repository: stackhpc/naming-things-is-hard name: Automatic tagging for ${{ github.ref_name }} 🏷 @@ -59,7 +59,7 @@ jobs: run: naming-things-is-hard/os-downstream-tag.py --release $(basename $(git rev-parse --abbrev-ref HEAD)) release: needs: [tag] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Release newly generated tag 🏷 steps: - name: Github checkout 🛎 [${{ github.repository }}] diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 028fd2a..5afa1da 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -4,7 +4,7 @@ name: Tox Workflow workflow_call: jobs: tox: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: From 9d74c4d3be7198a5365f2189310bc565a162f47b Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Tue, 1 Apr 2025 15:56:57 +0100 Subject: [PATCH 2/3] Remove Python 3.6 support --- .github/workflows/tox.yml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 5afa1da..1cdf9f0 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -9,22 +9,7 @@ jobs: fail-fast: false matrix: environment: [pep8,py3] - python-minor-version: [6,8,10,12] - is-not-python36: - - ${{ - (github.base_ref == 'stackhpc/zed') || - (github.ref == 'refs/heads/stackhpc/zed') || - (github.base_ref == 'stackhpc/2023.1') || - (github.ref == 'refs/heads/stackhpc/2023.1') || - (github.base_ref == 'stackhpc/2023.2') || - (github.ref == 'refs/heads/stackhpc/2023.2') || - (github.base_ref == 'stackhpc/2024.1') || - (github.ref == 'refs/heads/stackhpc/2024.1') || - (github.base_ref == 'stackhpc/2025.1') || - (github.ref == 'refs/heads/stackhpc/2025.1') || - (github.base_ref == 'stackhpc/master') || - (github.ref == 'refs/heads/stackhpc/master') - }} + python-minor-version: [8,10,12] is-not-python38: - ${{ ((github.repository == 'stackhpc/kayobe') && @@ -43,15 +28,6 @@ jobs: (github.ref == 'refs/heads/stackhpc/master') }} exclude: - - environment: pep8 - python-minor-version: 6 - - is-not-python36: true - python-minor-version: 6 - - is-not-python36: true - environment: pep8 - python-minor-version: 8 - - is-not-python36: false - python-minor-version: 10 - is-not-python38: true python-minor-version: 8 - is-primarily-python312: true From 4809caa87504372935f46df69949279ddff61a35 Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Tue, 1 Apr 2025 17:17:07 +0100 Subject: [PATCH 3/3] Refactor tox workflow matrix into separate step --- .github/workflows/tox.yml | 105 +++++++++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 1cdf9f0..c012470 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -3,38 +3,95 @@ name: Tox Workflow 'on': workflow_call: jobs: - tox: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - environment: [pep8,py3] - python-minor-version: [8,10,12] - is-not-python38: - - ${{ - ((github.repository == 'stackhpc/kayobe') && - ((github.base_ref == 'stackhpc/2024.1') || - (github.ref == 'refs/heads/stackhpc/2024.1'))) || + + define-matrix: + runs-on: ubuntu-latest + outputs: + tox-matrix: ${{ steps.matrix.outputs.tox-matrix }} + steps: + - name: Define Tox matrix + id: matrix + env: + PY3_8: ${{ + (github.base_ref == 'stackhpc/yoga') || + (github.ref == 'refs/heads/stackhpc/yoga') || + (github.base_ref == 'stackhpc/zed') || + (github.ref == 'refs/heads/stackhpc/zed') || + (github.base_ref == 'stackhpc/2023.1') || + (github.ref == 'refs/heads/stackhpc/2023.1') || + (((github.base_ref == 'stackhpc/2024.1') || + (github.ref == 'refs/heads/stackhpc/2024.1')) && + (github.repository != 'stackhpc/kayobe')) + }} + PY3_10: ${{ + (github.base_ref == 'stackhpc/zed') || + (github.ref == 'refs/heads/stackhpc/zed') || + (github.base_ref == 'stackhpc/2023.1') || + (github.ref == 'refs/heads/stackhpc/2023.1') || + (github.base_ref == 'stackhpc/2024.1') || + (github.ref == 'refs/heads/stackhpc/2024.1') || (github.base_ref == 'stackhpc/2025.1') || (github.ref == 'refs/heads/stackhpc/2025.1') || (github.base_ref == 'stackhpc/master') || (github.ref == 'refs/heads/stackhpc/master') - }} - is-primarily-python312: - - ${{ + }} + PY3_12: ${{ (github.base_ref == 'stackhpc/2025.1') || (github.ref == 'refs/heads/stackhpc/2025.1') || (github.base_ref == 'stackhpc/master') || (github.ref == 'refs/heads/stackhpc/master') - }} - exclude: - - is-not-python38: true - python-minor-version: 8 - - is-primarily-python312: true - environment: pep8 - python-minor-version: 10 - - is-primarily-python312: false - python-minor-version: 12 + }} + PEP8_8: ${{ + (github.base_ref == 'stackhpc/yoga') || + (github.ref == 'refs/heads/stackhpc/yoga') + }} + PEP8_10: ${{ + (github.base_ref == 'stackhpc/zed') || + (github.ref == 'refs/heads/stackhpc/zed') || + (github.base_ref == 'stackhpc/2023.1') || + (github.ref == 'refs/heads/stackhpc/2023.1') || + (github.base_ref == 'stackhpc/2024.1') || + (github.ref == 'refs/heads/stackhpc/2024.1') + }} + PEP8_12: ${{ + (github.base_ref == 'stackhpc/2025.1') || + (github.ref == 'refs/heads/stackhpc/2025.1') || + (github.base_ref == 'stackhpc/master') || + (github.ref == 'refs/heads/stackhpc/master') + }} + run: | + # Create a matrix based on the environment and Python minor version + output="[" + if [[ $PY3_8 == 'true' ]]; then + output+="{'environment': 'py3', 'python-minor-version': 8}," + fi + if [[ $PY3_10 == 'true' ]]; then + output+="{'environment': 'py3', 'python-minor-version': 10}," + fi + if [[ $PY3_12 == 'true' ]]; then + output+="{'environment': 'py3', 'python-minor-version': 12}," + fi + if [[ $PEP8_8 == 'true' ]]; then + output+="{'environment': 'pep8', 'python-minor-version': 8}," + fi + if [[ $PEP8_10 == 'true' ]]; then + output+="{'environment': 'pep8', 'python-minor-version': 10}," + fi + if [[ $PEP8_12 == 'true' ]]; then + output+="{'environment': 'pep8', 'python-minor-version': 12}," + fi + # remove trailing comma + output="${output%,}" + output+="]" + echo "tox-matrix=$output" >> $GITHUB_OUTPUT + + tox: + runs-on: ubuntu-latest + needs: define-matrix + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.define-matrix.outputs.tox-matrix) }} name: Tox ${{ matrix.environment }} with Python 3.${{ matrix.python-minor-version }} steps: