This project aims to test multiple Python versions and environments using GitHub Actions. The setup-python
action is utilized alongside the matrix strategy
to run multiple jobs across different configurations, ensuring compatibility and robustness.
The repository includes a Python script main.py
with a function double_number(x)
that takes a number as input and double it for the output. This functionality is validated through unit tests in test_main.py
.
-
main.py
: Contains thedouble_number(x)
function. -
test_main.py
: Contains test cases formain.py
. -
.devcontainer
: Configuration for development container. -
ci.yml
: GitHub Actions workflow for continuous integration (CI). -
Makefile
: Automation for code formatting, linting, and testing. -
requirements.txt
: Dependencies for the project. -
README.md
: Documentation (this file).
-
Codespaces Setup
- Open in Codespaces and wait for the container to build.
- The virtual environment will automatically activate and install dependencies from
requirements.txt
.
-
Development Workflow
- Make changes to
main.py
ortest_main.py
as necessary. - Push changes to GitHub, and GitHub Actions will automatically run the tests in multiple environments and operating systems.
- Make changes to
-
Code Formatting and Testing
https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python