-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 1.64 KB
/
tests.yml
File metadata and controls
66 lines (56 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Run Tests
on:
workflow_dispatch:
jobs:
commit-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: YAML Validity check
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: .
config_data: |
extends: relaxed
rules:
line-length: disable
trailing-spaces: disable
new-line-at-end-of-file: disable
document-start: disable
indentation: disable
truthy: disable
- name: Run GitLeaks secret scanner
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Ruff
uses: astral-sh/ruff-action@v3
with:
src: "./src"
args: "format --check"
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run generator (create Dockerfile, main.py and requirements.txt)
run: |
pip install nbformat
rm -rf src/services/
cd src/
python3 generator.py ../notebooks/
echo "Generated services:"
ls -la services/ || echo "No services directory"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov httpx nbformat fastapi papermill uvicorn pandas lxml
- name: Run tests with coverage
run: |
export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/src
python -m pytest --cov=src --cov-report=term-missing -s