Skip to content

Merge pull request #15 from devinslick/dev #65

Merge pull request #15 from devinslick/dev

Merge pull request #15 from devinslick/dev #65

Workflow file for this run

name: Tests
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
lint:
name: Lint and Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run flake8
run: |
python -m flake8 fmd_api/ tests/ --count --show-source --statistics
- name: Run mypy
run: |
python -m mypy fmd_api/
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run unit tests with coverage
run: |
python -m pytest tests/unit --cov=fmd_api --cov-branch --cov-report=xml --cov-report=term -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run functional tests (if credentials available)
# Skip on PRs from forks where secrets aren't available
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
continue-on-error: true
run: |
python -m pytest tests/functional -v
env:
# Optional: set up test credentials as repository secrets
FMD_BASE_URL: ${{ secrets.FMD_BASE_URL }}
FMD_ID: ${{ secrets.FMD_ID }}
FMD_PASSWORD: ${{ secrets.FMD_PASSWORD }}