---
name: Python CI
on:
push:
branches:
- main # Replace with the name of your main branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x # Replace with the desired Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Replace with your dependencies
- name: Run unit tests
run: python -m unittest UnitTest.py
Commit it to the main branch. After that, every time you push a new commit, GitHub Actions will setup your python project on Ubuntu and run all the unit tests automatically. You can even allow sending emails if the pipeline fails.
You can additionally setup flake8 check or something if you're interested.
Inside
.github/workflows
create YAML filepython_ci.yaml
:Commit it to the
main
branch. After that, every time you push a new commit, GitHub Actions will setup your python project on Ubuntu and run all the unit tests automatically. You can even allow sending emails if the pipeline fails.You can additionally setup flake8 check or something if you're interested.