version control #16
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r dev-requirements.txt | |
pip install "black[jupyter]" | |
- name: Run Isort to Auto-Fix Imports | |
run: | | |
isort . --skip-glob "*.ipynb" # Automatically fix import order for all files except Jupyter notebooks | |
- name: Run Isort Check | |
run: | | |
isort --check-only . --skip-glob "*.ipynb" # Verify that all imports are correctly sorted | |
- name: Run Black | |
run: | | |
black . --exclude "\.ipynb$" | |
- name: Run Pylint | |
run: | | |
pylint src tests --ignore-patterns=".*\.ipynb$" | |
- name: Run tests with coverage | |
run: | | |
pytest --cov=src tests/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |