This repository contains both a GitHub action and a reusable workflow.
The action (action.yaml) does the following:
- Sets up a virtual environment
- Installs the package under test
- Installs necessary dependencies
- Runs tests using
pytest - Tests publishing of the package (optional)
The reusable workflow (pytest.yaml) does the following:
- Generates a strategy of which Python and OS versions to test
- For the matrix of Python and OS versions:
- Sets up Python
- Runs the test action described above
- Uploads code coverage (optional)
The strategy is generated by genstrat.py which is a small utility to generate
a strategy.json file. Refer to genstrat.py --help for usage, including
default values for OS and Python versions in the strategy matrix. Refer to
pytest.yaml for how to specify arguments to the reusable workflow, which
ultimately calls genstrat.py.