From 37cd9a15017145e0ac2af683fc897b9f009f29e3 Mon Sep 17 00:00:00 2001 From: Akshay Mestry Date: Thu, 21 Nov 2024 20:05:01 -0600 Subject: [PATCH] ci: add support for multi-environment builds Signed-off-by: Akshay Mestry --- .github/workflows/multienv.yml | 58 ++++++++++++++++++++++++++++++++++ pyproject.toml | 8 +++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/multienv.yml diff --git a/.github/workflows/multienv.yml b/.github/workflows/multienv.yml new file mode 100644 index 0000000..6ce7a13 --- /dev/null +++ b/.github/workflows/multienv.yml @@ -0,0 +1,58 @@ +# Multi-Environment Testing Workflow +# ================================== +# +# Author: Akshay Mestry +# Created on: Thursday, November 21 2024 +# Last updated on: Thursday, November 21 2024 + +name: multienv-testing +run-name: Started ${{ github.workflow }} + +on: + workflow_dispatch: + pull_request: + paths: + - '**.py' + - 'pyproject.toml' + - 'requirements*' + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: test with ${{ matrix.env }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + env: + - '3.12' + - '3.11' + - '3.10' + - '3.9' + - '3.8' + os: + - macos-latest + - ubuntu-latest + - windows-latest + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 + with: + fetch-depth: 1 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + - name: Install tox + run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv --with tox-gh + - name: Install Python + if: matrix.env != '3.13' + run: uv python install --python-preference only-managed ${{ matrix.env }} + - name: Run tox suite + run: tox run -vv + env: + TOX_GH_MAJOR_MINOR: ${{ matrix.env }} diff --git a/pyproject.toml b/pyproject.toml index ea14e7a..59026ad 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,3 +79,11 @@ commands = [ ["isort", "--sl", "coeus_sphinx_theme/"], ["mypy", "coeus_sphinx_theme/"], ] + +[tool.tox.gh.python] +"3.13" = ["3.13", "type", "pkg_meta"] +"3.12" = ["3.12"] +"3.11" = ["3.11"] +"3.10" = ["3.10"] +"3.9" = ["3.9"] +"3.8" = ["3.8"]