~Engineers solve problems, I solve engineer's problems 🤘
Github Actions is one of the best things to come out of Github. If you dont know about it you can read here. Basically it makes your CI/CD extremeely easy to configure and manage. You can set up workflows to tell the github to build, test, package, release or deploy code in any repository in your preferred order. And you can have multiple workflows for a single repository also.
Here is an example how to set it up:
Create .github/workflows directory in the root of your repository.
Create a yaml file inside the above folder that will define steps you want to run along with thier order and configuration. You can read the docs of what can be included here.
As an example here, I am making the workflow to package and run unit test cases in the yaml.
name: Run unit test cases
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: set up python
- uses: actions/setup-python@v1
- name: install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: run tests
run: |
pytest