-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.43 KB
/
github_workflows_ci.yml
File metadata and controls
48 lines (42 loc) · 1.43 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
name: Basic CI (no MATLAB required)
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
basic-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: SPDX / license header check (.m files)
run: |
python3 tools/test_check_spdx.py || exit $?
- name: Detect large files (>10MB)
run: |
echo "Searching for files larger than 10MB..."
big=$(git ls-files -z | xargs -0 -I{} bash -c 'f="{}"; s=$(stat -c%s "$f" 2>/dev/null || echo 0); if [ "$s" -gt $((10*1024*1024)) ]; then echo "$f|$s"; fi' || true)
if [ -n "$big" ]; then
echo "Found large files (name|size):"
echo "$big"
echo "Please avoid committing large binaries. Consider using git-lfs or remove them."
exit 1
else
echo "No large files found."
fi
- name: Run Python tests if present
run: |
if [ -d "tests" ]; then
if [ -f "requirements-dev.txt" ]; then
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
fi
pytest -q || { echo "pytest failed"; exit 1; }
else
echo "No tests/ directory found, skipping pytest."
fi