diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..2718f5f --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -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') + "