data-pipeline/.forgejo/workflows/ci.yml

47 lines
1 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
flake8 src/ --max-line-length=120 --ignore=E501,W503
- name: Run tests
run: pytest tests/ -v --tb=short
validate-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate pipeline config
run: |
pip install pyyaml
python3 -c "
import yaml, sys
with open('config/pipeline.yml') as f:
cfg = yaml.safe_load(f)
assert 'pipeline' in cfg
assert 'source' in cfg['pipeline']
assert 'destination' in cfg['pipeline']
print('Config OK')
"