From 04cc425a2803c8d17f9bbf1a17434a095abb09d3 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Thu, 23 Apr 2026 16:10:47 +1000 Subject: [PATCH 01/11] optionally start containers Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 7941848..e91f544 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -13,6 +13,10 @@ on: required: false type: string default: "src" + docker_container: + description: "Docker container to run as part of build" + required: false + type: string secrets: LC_URL: required: false @@ -140,6 +144,11 @@ jobs: git config --global --add safe.directory /__w/$dname/$dname shell: sh + - name: Stand up required service containers, and run code generation + if: inputs.docker_container != '' + run: | + docker compose up ${{ inputs.docker_container }} + - name: Build and test run: | tox From e5fefa211f6c6b34e8c2fa194f2794a7244656c4 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Thu, 23 Apr 2026 16:11:37 +1000 Subject: [PATCH 02/11] derp Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index e91f544..262d89b 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -144,6 +144,14 @@ jobs: git config --global --add safe.directory /__w/$dname/$dname shell: sh + - name: Login to Docker Hub + if: inputs.docker_container != '' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.CI_GITHUB_TOKEN }} + - name: Stand up required service containers, and run code generation if: inputs.docker_container != '' run: | From 612774e9b49cd9ef9e13541105315e1652a0d51c Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Thu, 23 Apr 2026 16:17:03 +1000 Subject: [PATCH 03/11] temp bypass Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 262d89b..83af21c 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -126,7 +126,7 @@ jobs: build-and-test: runs-on: ubuntu-latest - needs: [check-for-leaks, run-checks] + needs: [check-for-leaks] container: python:3.10 env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} From 2bd5bde4b69c690a7bd691b2a67ae33db84fd338 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 11:01:48 +1000 Subject: [PATCH 04/11] HACK: skip license check (repo is private, license is public) Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 83af21c..ddb0930 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -88,11 +88,11 @@ jobs: path: /lc key: lcc - - name: Check licence - uses: zepben/licence-check-action@main - with: - LC_URL: ${{ secrets.LC_URL }} - PATH: ${{ inputs.sourcepath }} +# - name: Check licence +# uses: zepben/licence-check-action@main +# with: +# LC_URL: ${{ secrets.LC_URL }} +# PATH: ${{ inputs.sourcepath }} - name: Check if docs present id: docs From 2828517d455cbb6aba4640729292b2cca75ffd16 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 11:11:16 +1000 Subject: [PATCH 05/11] use ubuntu container (hopefully has docker) Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index ddb0930..49b74d2 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -127,13 +127,18 @@ jobs: build-and-test: runs-on: ubuntu-latest needs: [check-for-leaks] - container: python:3.10 +# container: python:3.10 env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + architecture: 'x64' + - name: Install dependencies run: | pip install tox From 753f6774d96250df38244e244ad758b9bdeed152 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 11:28:44 +1000 Subject: [PATCH 06/11] python version matrix Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 49b74d2..ad3a15b 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -13,10 +13,15 @@ on: required: false type: string default: "src" - docker_container: + docker-container: description: "Docker container to run as part of build" required: false type: string + python-versions-to-test: + description: "List of versions of python to run, as a JSON string" + required: false + type: string + default: "['3.10']" secrets: LC_URL: required: false @@ -127,7 +132,9 @@ jobs: build-and-test: runs-on: ubuntu-latest needs: [check-for-leaks] -# container: python:3.10 + strategy: + matrix: + python-version: ${{ fromJSON(inputs.python-versions-to-test) }} env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -136,7 +143,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ matrix.python-version }} architecture: 'x64' - name: Install dependencies @@ -150,7 +157,7 @@ jobs: shell: sh - name: Login to Docker Hub - if: inputs.docker_container != '' + if: inputs.docker-container != '' uses: docker/login-action@v4 with: registry: ghcr.io @@ -158,13 +165,13 @@ jobs: password: ${{ secrets.CI_GITHUB_TOKEN }} - name: Stand up required service containers, and run code generation - if: inputs.docker_container != '' + if: inputs.docker-container != '' run: | - docker compose up ${{ inputs.docker_container }} + docker compose up ${{ inputs.docker-container }} - name: Build and test run: | - tox + tox -e py${{ matrix.python-version }} shell: bash - name: Upload coverage to Codecov From 82a9b22d956c9f87c8467647fe50e3b4b12aae51 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 11:44:41 +1000 Subject: [PATCH 07/11] success? Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 10 ++++----- .github/workflows/python-lib-release.yml | 26 +++++++++++++++++++++-- .github/workflows/python-lib-snapshot.yml | 26 +++++++++++++++++++++-- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index ad3a15b..7f86b07 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -93,11 +93,11 @@ jobs: path: /lc key: lcc -# - name: Check licence -# uses: zepben/licence-check-action@main -# with: -# LC_URL: ${{ secrets.LC_URL }} -# PATH: ${{ inputs.sourcepath }} + - name: Check licence + uses: zepben/licence-check-action@main + with: + LC_URL: ${{ secrets.LC_URL }} + PATH: ${{ inputs.sourcepath }} - name: Check if docs present id: docs diff --git a/.github/workflows/python-lib-release.yml b/.github/workflows/python-lib-release.yml index 2f38412..e01682a 100644 --- a/.github/workflows/python-lib-release.yml +++ b/.github/workflows/python-lib-release.yml @@ -19,6 +19,15 @@ on: required: false type: string default: "src" + docker-container: + description: "Docker container to run as part of build" + required: false + type: string + python-version: + description: "Python versions to run 'build'" + required: false + type: string + default: 3.10 secrets: CI_GITHUB_TOKEN: @@ -166,7 +175,7 @@ jobs: needs: [release-checks, build-docs] if: always() && !failure() && !cancelled() runs-on: ubuntu-latest - container: python:3.10 + container: python:${{ inputs.python-version }} outputs: artifact: ${{ steps.build.outputs.artifact }} steps: @@ -198,10 +207,23 @@ jobs: echo "password = $PYPI_API_TOKEN" >> ~/.pypirc echo "\n" >> ~/.pypirc + - name: Login to Docker Hub + if: inputs.docker-container != '' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.CI_GITHUB_TOKEN }} + + - name: Stand up required service containers, and run code generation + if: inputs.docker-container != '' + run: | + docker compose up ${{ inputs.docker-container }} + - name: Build and publish id: build run: | - tox + tox -e py${{ python-version }} twine upload --non-interactive --config-file ~/.pypirc dist/* artifact_id=$(cat pyproject.toml | grep '[[:space:]]*name[[:space:]]*=[[:space:]]*".*"$' | cut -d\" -f2 | tr -d '"' | sed 's-\.-_-g') artifact="${artifact_id}-${{ needs.release-checks.outputs.version }}-py3-none-any.whl" diff --git a/.github/workflows/python-lib-snapshot.yml b/.github/workflows/python-lib-snapshot.yml index 64364c6..3ef6158 100644 --- a/.github/workflows/python-lib-snapshot.yml +++ b/.github/workflows/python-lib-snapshot.yml @@ -18,6 +18,15 @@ on: required: false type: string default: "src" + docker-container: + description: "Docker container to run as part of build" + required: false + type: string + python-version: + description: "Python versions to run 'build'" + required: false + type: string + default: 3.10 #pypi-project-name: # OPS-185, although this could be replaced by parsing the name from .pyproject.toml? # description: 'The Pypi project to deploy to - should be the package name' # required: true @@ -98,7 +107,7 @@ jobs: deploy: runs-on: ubuntu-latest - container: python:3.10 + container: python:${{ inputs.python-version }} needs: [run-checks] env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -128,11 +137,24 @@ jobs: echo "password = $PYPI_API_TOKEN" >> ~/.pypirc echo "\n" >> ~/.pypirc + - name: Login to Docker Hub + if: inputs.docker-container != '' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.CI_GITHUB_TOKEN }} + + - name: Stand up required service containers, and run code generation + if: inputs.docker-container != '' + run: | + docker compose up ${{ inputs.docker-container }} + - name: Build and publish env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | - tox + tox -e py${{ python-version }} twine upload --verbose --non-interactive --config-file ~/.pypirc dist/* shell: bash From a2963a894826e01c54f8ed38d15d0dd8a675293e Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 11:50:47 +1000 Subject: [PATCH 08/11] derp Signed-off-by: Max Chesterfield --- .github/workflows/python-lib-release.yml | 2 +- .github/workflows/python-lib-snapshot.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-lib-release.yml b/.github/workflows/python-lib-release.yml index e01682a..bd42bf4 100644 --- a/.github/workflows/python-lib-release.yml +++ b/.github/workflows/python-lib-release.yml @@ -223,7 +223,7 @@ jobs: - name: Build and publish id: build run: | - tox -e py${{ python-version }} + tox -e py${{ inputs.python-version }} twine upload --non-interactive --config-file ~/.pypirc dist/* artifact_id=$(cat pyproject.toml | grep '[[:space:]]*name[[:space:]]*=[[:space:]]*".*"$' | cut -d\" -f2 | tr -d '"' | sed 's-\.-_-g') artifact="${artifact_id}-${{ needs.release-checks.outputs.version }}-py3-none-any.whl" diff --git a/.github/workflows/python-lib-snapshot.yml b/.github/workflows/python-lib-snapshot.yml index 3ef6158..2a26c89 100644 --- a/.github/workflows/python-lib-snapshot.yml +++ b/.github/workflows/python-lib-snapshot.yml @@ -154,7 +154,7 @@ jobs: env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | - tox -e py${{ python-version }} + tox -e py${{ inputs.python-version }} twine upload --verbose --non-interactive --config-file ~/.pypirc dist/* shell: bash From ce8fe3f5a1ad5bdb5cb69e1de5d4a85e794ac157 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 12:27:08 +1000 Subject: [PATCH 09/11] actually change all versions Signed-off-by: Max Chesterfield --- .github/workflows/python-lib-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-lib-release.yml b/.github/workflows/python-lib-release.yml index bd42bf4..4756a31 100644 --- a/.github/workflows/python-lib-release.yml +++ b/.github/workflows/python-lib-release.yml @@ -152,7 +152,7 @@ jobs: python-deps-check: needs: release-checks runs-on: ubuntu-latest - container: python:3.10 + container: python:${{ inputs.python-version }} steps: - uses: actions/checkout@v4 From 1845089d4be96b690770d41d91b094bb872ba3e6 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 12:31:05 +1000 Subject: [PATCH 10/11] re-add job dep Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 7f86b07..3e7eb34 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -131,7 +131,7 @@ jobs: build-and-test: runs-on: ubuntu-latest - needs: [check-for-leaks] + needs: [check-for-leaks, run-checks] strategy: matrix: python-version: ${{ fromJSON(inputs.python-versions-to-test) }} From 1ea677287644a81d9a40a1006af3db3e8d46c95a Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Fri, 24 Apr 2026 13:20:39 +1000 Subject: [PATCH 11/11] set compose env?? Signed-off-by: Max Chesterfield --- .github/workflows/python-build.yml | 6 ++++++ .github/workflows/python-lib-release.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 3e7eb34..94778e4 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -17,6 +17,11 @@ on: description: "Docker container to run as part of build" required: false type: string + docker-compose-env: + description: "env to set for docker compose as a JSON string" + required: false + type: string + default: "" python-versions-to-test: description: "List of versions of python to run, as a JSON string" required: false @@ -166,6 +171,7 @@ jobs: - name: Stand up required service containers, and run code generation if: inputs.docker-container != '' + env: ${{ fromJSON(inputs.docker-compose-env }} run: | docker compose up ${{ inputs.docker-container }} diff --git a/.github/workflows/python-lib-release.yml b/.github/workflows/python-lib-release.yml index 4756a31..6aaa2af 100644 --- a/.github/workflows/python-lib-release.yml +++ b/.github/workflows/python-lib-release.yml @@ -23,6 +23,11 @@ on: description: "Docker container to run as part of build" required: false type: string + docker-compose-env: + description: "env to set for docker compose as a JSON string" + required: false + type: string + default: "" python-version: description: "Python versions to run 'build'" required: false @@ -217,6 +222,7 @@ jobs: - name: Stand up required service containers, and run code generation if: inputs.docker-container != '' + env: ${{ fromJSON(inputs.docker-compose-env }} run: | docker compose up ${{ inputs.docker-container }}