Skip to content

feat: add initial project structure with CI, tools, and tests #1

feat: add initial project structure with CI, tools, and tests

feat: add initial project structure with CI, tools, and tests #1

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Lint with Ruff
run: |
ruff check jackknife tests tools
- name: Check format with Ruff
run: |
ruff format --check jackknife tests tools
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- 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
python -m pip install -e ".[dev]"
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Test with pytest
run: |
python -m pytest
- name: Upload coverage report
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# Report badge for code coverage
# We don't actually need to run the tests here since we run them above
coverage-badge:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
pip install genbadge[coverage]
- name: Generate coverage badge
run: |
mkdir -p .github/badges
genbadge coverage -o .github/badges/coverage.svg