Skip to content

solve quality bot warning #2418

solve quality bot warning

solve quality bot warning #2418

Workflow file for this run

name: Tests and Examples
permissions:
contents: read
on:
push:
branches:
- '**'
paths:
- 'src/**'
- 'tests/**'
- 'examples/**'
- '.github/workflows/testing.yml'
- 'environment.yml'
- 'pyproject.toml'
- 'uv.lock'
pull_request:
branches:
- '**'
paths:
- 'src/**'
- 'tests/**'
- 'examples/**'
- '.github/workflows/testing.yml'
- 'environment.yml'
- 'pyproject.toml'
- 'uv.lock'
schedule:
- cron: '0 0 * * *' # Every day at 00:00 UTC
jobs:
test:
name: Run Tests and Examples (${{ matrix.os }} / py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v5
# --------------------
# Linux path (uv)
# --------------------
- name: Set up Python (Linux)
if: runner.os == 'Linux'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv (Linux)
if: runner.os == 'Linux'
uses: astral-sh/setup-uv@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
uv sync --dev
- name: Run tests (Linux)
if: runner.os == 'Linux'
run: |
uv run pytest tests --cov=src --cov-report=xml --cov-report=term
- name: Run examples (Linux)
if: runner.os == 'Linux'
run: |
cd examples
uv run bash run_examples.sh
- name: Upload coverage to Codecov (Linux + py3.11 only)
if: runner.os == 'Linux' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
slug: PLAID-lib/plaid
name: python-${{ matrix.python-version }}
verbose: true
# --------------------
# macOS / Windows path (conda)
# --------------------
- name: Set up Conda (macOS/Windows)
if: runner.os != 'Linux'
uses: conda-incubator/setup-miniconda@v2
with:
use-mamba: true
auto-activate-base: false
miniforge-variant: Miniforge3
- name: Create environment (macOS/Windows)
if: runner.os != 'Linux'
run: |
mamba env create -n plaid-dev python=${{ matrix.python-version }} -f environment.yml
conda run -n plaid-dev pip install -e . --no-deps
- name: Run tests (macOS/Windows)
if: runner.os != 'Linux'
run: |
conda run -n plaid-dev pytest tests
- name: Run examples (macOS)
if: runner.os == 'macOS'
run: |
cd examples
conda run -n plaid-dev bash run_examples.sh
- name: Run examples (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
cd examples
conda run -n plaid-dev run_examples.bat