Add tests, fixtures, and CI/CD workflow
Some checks failed
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.8) (push) Has been cancelled
CI / test (ubuntu-latest, 3.9) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test-minimal (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled
CI / release (push) Has been cancelled

This commit is contained in:
2026-02-03 04:18:35 +00:00
parent b542b34758
commit 589c6d7387

141
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,141 @@
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest]
exclude:
- python-version: '3.8'
os: [macos-latest, windows-latest]
- python-version: '3.9'
os: [macos-latest, windows-latest]
steps:
- 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 --upgrade pip
pip install -e ".[dev]"
- name: Lint with ruff
run: |
pip install ruff
ruff check .
- name: Run tests with pytest
run: pytest -v
- name: Run tests with coverage
run: |
pip install pytest-cov
pytest --cov=dataforge --cov-report=term-missing --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: false
test-minimal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip'
- name: Install and test
run: |
pip install --upgrade pip
pip install pytest
pip install -e .
pytest -v
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install linting tools
run: |
pip install ruff black mypy
- name: Run ruff
run: ruff check .
- name: Run black
run: black --check .
- name: Run mypy
run: mypy dataforge/ --ignore-missing-imports
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install build tools
run: |
pip install build
- name: Build package
run: python -m build
- name: Verify package
run: |
pip install dist/*.whl
dataforge --help
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
release:
needs: [test, lint, build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Create Release
uses: https://gitea.com/actions/release-action@main
with:
files: |
dist/*.whl
dist/*.tar.gz
title: ${{ github.ref_name }}
body: "Release ${{ github.ref_name }}"
draft: false
prerelease: false