Merge pull request #3 from johnHostetter/dev #10
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9"] | |
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 }} | |
cache: 'pip' | |
- name: Install dependencies 🔧 | |
run: | | |
python -m pip install pip==24.0 | |
python -m pip install wheel==0.42.0 | |
python -m pip install setuptools==69.1.0 | |
python -m pip install pytest | |
python -m pip install codecov | |
python -m pip install pytest-cov | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f test_requirements.txt ]; then pip install -r test_requirements.txt; fi | |
python -m pip install -e . # install the package | |
- name: Run tests and collect coverage 🧪 | |
run: | | |
# specify the directory to test (e.g., unit_tests) & directory to save the coverage report | |
# this prevents running submodules' tests | |
pytest --cov=src tests -p no:warnings -v | |
- name: Upload coverage to Codecov 📊 | |
uses: codecov/codecov-action@v4 | |
with: | |
verbose: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |