-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 2.22 KB
/
python-test.yml
File metadata and controls
89 lines (76 loc) · 2.22 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Reproducibility CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
release:
types: [published]
jobs:
check-artifacts:
name: Check Critical Artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify critical files presence
run: |
MISSING=0
for file in \
Data_Package_FAIR2/Compound_Properties_Database.csv \
Data_Package_FAIR2/API_Calculations_Full.xlsx \
Data_Package_FAIR2/Python_Code_API_Monte_Carlo.py \
Data_Package_FAIR2/R_Code_Figures_S2.R; do
if [ ! -f "$file" ]; then
echo "❌ MISSING: $file"
MISSING=$((MISSING + 1))
else
echo "✅ OK: $file"
fi
done
if [ $MISSING -gt 0 ]; then
echo "::error::$MISSING critical files missing"
exit 1
fi
test-reproducibility:
name: Test 1-Click Reproducibility
runs-on: ubuntu-latest
needs: check-artifacts
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r Data_Package_FAIR2/requirements.txt
pip install pytest pytest-cov
- name: Validate data integrity
run: |
cd Data_Package_FAIR2
python data_validation.py
- name: Quick Check API values
timeout-minutes: 2
run: |
cd Data_Package_FAIR2
python quickcheck_api.py
- name: Run full API calculation (< 60s)
timeout-minutes: 2
run: |
cd Data_Package_FAIR2
mkdir -p output
python Python_Code_API_Monte_Carlo.py --all
- name: Run unit tests
run: |
cd Data_Package_FAIR2
python -m pytest test_api_calculations.py -v --tb=short --cov=. --cov-report=term
- name: Upload test outputs
uses: actions/upload-artifact@v3
if: always()
with:
name: test-outputs
path: |
Data_Package_FAIR2/output/
Data_Package_FAIR2/*.png
retention-days: 30