Add CI workflow for lint, tests, and config validation
This commit is contained in:
parent
0b31344c4c
commit
0804d26792
1 changed files with 47 additions and 0 deletions
47
.forgejo/workflows/ci.yml
Normal file
47
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
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')
|
||||||
|
"
|
||||||
Loading…
Reference in a new issue