SOLO Activity: GitHub actions
In this activity you will apply the previous lessons to automate the documentation and testing using GitHub actions. This activity can be completed on your own solo project, or as part of a group project. The requirements are that the project has a python module that can be installed, has at least one function with a docstring, and at least one test function.
- For your software project create a GitHub action that will build and test your python module.
- “Build” in this case means install the required dependencies and then install your module using
pip install -e .
- The test phase can be carried out using either a test suite such as
pytest
, or by running your test script directly. If you are using a personal test script then you should ensure that it will exit withstatus != 0
when the tests fail, so that the build/test workflow will also report a failure.
- “Build” in this case means install the required dependencies and then install your module using
- Use the GitHub online editor to create/modify the relevant
.yml
files and seton
status to bepush
so that the workflow will run each time that you make changes to the.yml
file. - Once you have a working build/test workflow, create a documentation workflow.
- Use the build/test workflow as a template and remove the test phase and replace it with a documentation build.
- Modify the documentation step such that it will produce an artefact which is the contents of the documentation directory.
- Verify that your documentation has completed properly by downloading and viewing the workflow artefact.