Skip to content

Commit d78da9d

Browse files
ci: address review feedback - optimize CI pipeline
- Use minimal requirements-ci.txt (no tensorflow/heavy deps) - Handle pytest exit code 5 (no tests) vs real failures - Move Dockerfile build to separate job with path filter - Add pyzmq to CI deps (required by concore.py)
1 parent dea0d66 commit d78da9d

2 files changed

Lines changed: 38 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main, master]
88

99
jobs:
10-
test:
10+
lint-and-test:
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -23,8 +23,8 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
27-
pip install pytest ruff
26+
pip install -r requirements-ci.txt
27+
# Uses minimal CI requirements (no tensorflow/heavy packages)
2828

2929
- name: Run linter (ruff)
3030
run: |
@@ -47,13 +47,37 @@ jobs:
4747
--ignore=measurements/ \
4848
--ignore=0mq/ \
4949
--ignore=ratc/ \
50-
--ignore=linktest/ \
51-
|| true
52-
# Allow pytest to pass even if no tests are collected yet
53-
# Remove "|| true" once proper tests are added
54-
# Ignores: experimental/config-dependent scripts
50+
--ignore=linktest/
51+
status=$?
52+
# Allow success if no tests are collected (pytest exit code 5)
53+
if [ "$status" -ne 0 ] && [ "$status" -ne 5 ]; then
54+
exit "$status"
55+
fi
56+
# Fails on real test failures, passes on no tests collected
57+
58+
docker-build:
59+
runs-on: ubuntu-latest
60+
# Only run when Dockerfile.py or related files change
61+
if: |
62+
github.event_name == 'push' ||
63+
(github.event_name == 'pull_request' &&
64+
contains(github.event.pull_request.changed_files, 'Dockerfile'))
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
70+
- name: Check if Dockerfile.py changed
71+
uses: dorny/paths-filter@v3
72+
id: filter
73+
with:
74+
filters: |
75+
dockerfile:
76+
- 'Dockerfile.py'
77+
- 'requirements.txt'
5578
5679
- name: Validate Dockerfile build
80+
if: steps.filter.outputs.dockerfile == 'true'
5781
run: |
5882
docker build -f Dockerfile.py -t concore-py-test .
5983
# Validates that Dockerfile.py can be built successfully

requirements-ci.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Minimal dependencies for CI (linting and testing)
2+
# Does not include heavyweight packages like tensorflow
3+
pytest
4+
ruff
5+
pyzmq
6+
numpy

0 commit comments

Comments
 (0)