This repository demonstrates a GitHub Actions workflow which tests a basic Python script across multiple Python versions and Ubuntu versions. In order to accomplish this, a workflow yml file is set up with a GH Actions matrix build.
-
A Makefile, which runs required installations, and then formats using Black, lints using Pylint, and tests the code using pytest.
-
A requirements.txt file, which lists out some basic DevOps and Data Science packages pinned to specific versions for installation.
-
A devcontainer folder.
-
Github Actions workflows directory and yml file for CI/CD integration and a matrix build.
-
A basic Python script main.py for creating a data visualization and generating descriptive statistics of a seaborn dataset on healthcare spending data across multiple countries and years.
-
A testing script which tests the functions of the Python script main.py.
Add seaborn and any other required packages along with the compatible versions to the requirements.txt.
Create Makefile and devcontainer folder with Dockerfile and json for environmental setup.
Update your GH Actions workflow yml file to build the code using different Python versions with a matrix build.
Create a main.py file with a load_data() function, which loads a seaborn dataset called "healthexp" with the following columns:
- Country (either the US, Japan, Canada, Germany, France, or Great Britain)
- Year (data collected between 1970-2020)
- Healthcare spending per person in USD
- Life expectancy
The main.py file also contains a generate_summary_stats() function to describe the dataset, and a generate_line_graph() function to produce a line graph of healthcare spending specifically in the US between 1970-2020.
A separate test_main.py file is used to test the generate_summary_stats() and generate_line_graph() functions.
Upon pushing to the repository, the GH Actions workflow is run using different Python versions, and all the steps of the Makefile successfully pass for each version.