Add ci workflow to run unit tests on pr or merge into main branches S… #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- trunk | |
- 'fix*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python Version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install coverage | |
- name: Run Unit Tests | |
run: | | |
coverage run -m pytest unit_tests | |
- name: Evaluate Coverage | |
coverage report --omit="unit_tests/*" -i --fail-under=30 | |