GitHub Actions is a tool integrated with GitHub for continuous integration and delivery (CI/CD). It allows to automate tasks like testing and checking the quality of the code directly within a GitHub repository.
We defined five different actions, each activated under certain conditions:
-
- Trigger: On changes to the src folder
- Actions: Runs a job for Pylint and one for Flake8 in the src folder
- Criteria: Fails if the Pylint quality score is below 8 or if Flake8 finds errors
-
- Trigger: On changes to specific src sub-folders (api, tests, data, features, models)
- Actions: Runs Pytest tests to verify proper functionality
- Purpose: Ensures everything works correctly in the specified sub-folders
-
- Trigger: On changes to specific src sub-folders (data, features, models)
- Actions: Executes main pipeline steps to validate system integrity post-changes
- Purpose: Confirm that the system doesn't fail after changes
-
- Trigger: On push onto main branch
- Actions: Builds a Docker image and deploys it on Azure
- Purpose: Continous Deployment of the MusicExpress's production version
-
- Trigger: On push onto staging branch
- Actions: Builds a Docker image and deploys it on Azure
- Purpose: Continous Deployment of the MusicExpress's staging version
-
- Trigger: On push onto src/tests/DataDrift/ and data/raw/ folders
- Actions: Checks for Data Drift in the default data and stores a report
- Purpose: Check if there are differences among the two datasets
DVC has been utilized to retrieve the required data within the following actions:
Within each action different jobs can be defined. Those are run in parallel allowing us to check different things at the same time. For example, in the API and Scripts Testing we check that the tests for our API and the ones for our Python scripts still work thanks to two different jobs named, respectively, api-testing and scripts-testing.