|
1 | | -# This Dockerfile onnly for GH action runs and performs: |
| 1 | +# This Dockerfile only for GH action runs and performs: |
2 | 2 | # 1) Code lint checking |
3 | 3 | # 2) Runs tests from tests/ |
4 | 4 | # |
@@ -34,39 +34,8 @@ COPY . . |
34 | 34 | # Install python dependencies |
35 | 35 | RUN uv sync |
36 | 36 |
|
37 | | -# Step 1: Code lint checking with ruff |
38 | | -RUN echo "=== Running Code Linting ===" && \ |
39 | | - uv run ruff check . && \ |
40 | | - uv run ruff format --check . |
| 37 | +# Make script executable |
| 38 | +RUN chmod +x scripts/ci.sh |
41 | 39 |
|
42 | | -# Step 2: Run tests |
43 | | -RUN echo "=== Running Python Script(s) Tests ===" && \ |
44 | | - uv run pytest -v tests/test_evals.py \ |
45 | | - tests/test_models.py::test_api_connection_with_no_env_load |
46 | | - |
47 | | -# Step 3: Run tests for ground truth with corrresponding testbench |
48 | | -RUN echo "=== Running Verilog Tests ===" && \ |
49 | | - # Collect all filenames in a directory: |
50 | | - # 1) tb_*.v and 2) answer_*.v |
51 | | - cd dataset/testbench/hdlbits && \ |
52 | | - find . -name "tb_*.v" | while read tb_path; do \ |
53 | | - # Get directory and filename |
54 | | - dir=$(dirname "$tb_path"); \ |
55 | | - tb_file=$(basename "$tb_path"); \ |
56 | | - base=${tb_file#tb_}; \ |
57 | | - base=${base%.v}; \ |
58 | | - answer_file="answer_${base}.v"; \ |
59 | | - answer_path="${dir}/${answer_file}"; \ |
60 | | - \ |
61 | | - if [ -f "$answer_path" ]; then \ |
62 | | - echo "Testing: ${dir}/${base}"; \ |
63 | | - cd "$dir" && \ |
64 | | - # Run verilog testbench using icarus verilog |
65 | | - iverilog -o test_${base} ${tb_file} ${answer_file} && \ |
66 | | - vvp test_${base} || (echo "✗ Test failed: ${dir}/${base}" && exit 1); \ |
67 | | - cd - > /dev/null; \ |
68 | | - else \ |
69 | | - echo "⚠ Missing answer file: $answer_path"; \ |
70 | | - fi; \ |
71 | | - done && \ |
72 | | - echo "✓ All Verilog tests passed!" |
| 40 | +# Runner/Executable point |
| 41 | +CMD ["./scripts/ci.sh"] |
0 commit comments