Skip to content

Merge pull request #93 from UBC-MDS/yhouyang02-patch-1 #73

Merge pull request #93 from UBC-MDS/yhouyang02-patch-1

Merge pull request #93 from UBC-MDS/yhouyang02-patch-1 #73

Workflow file for this run

name: Build and Test Package
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for
# the main branch and the otter (staging) branch
push:
branches: [ main, otter ]
pull_request:
branches: [ main, otter ]
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
lint_check:
runs-on: ubuntu-latest
steps:
- name: Check-out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[lint]
- name: Run ruff formatter
run: |
ruff check .
build_and_test_package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.13"]
steps:
- name: Check-out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run tests with coverage
run: |
pytest --cov --cov-branch --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}