This commit is contained in:
David Lord 2025-06-17 09:55:49 -07:00
parent 85c5d93cbd
commit 2d578d8c53
No known key found for this signature in database
GPG key ID: 43368A7AA8CC5926
6 changed files with 43 additions and 128 deletions

View file

@ -0,0 +1,26 @@
name: get test environments
description: Inspect a Python project and generate a test environment matrix.
inputs:
windows-env:
description: Include a Windows environment with the latest Python version.
required: false
default: 'false'
macos-env:
description: Include a macOS environment with the latest Python version.
required: false
default: 'false'
extra-envs:
description: Add these additional environments to the output.
required: false
default: ''
outputs:
matrix:
description: A JSON list of test environments.
value: ${{ steps.run.outputs.matrix }}
runs:
using: composite
steps:
- name: get test environments
id: run
shell: bash
run: python3 -Iu '${{github.action_path}}/run.py'

15
.github/actions/python-versions/run.py vendored Normal file
View file

@ -0,0 +1,15 @@
import configparser
import os
import tomllib
tox_conf = configparser.ConfigParser(interpolation=None)
tox_conf.read("tox.ini", "utf-8")
with open("pyproject.toml", "rb") as f:
pyproj = tomllib.load(f)
print(tox_conf)
print(tomllib)
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as f:
print("[]", file=f)