-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (90 loc) · 4.92 KB
/
ci.yml
File metadata and controls
102 lines (90 loc) · 4.92 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: ci
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
tags: openstudio-mcp:dev
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run unit tests
run: |
mkdir -p runs
docker run --rm -v "$PWD:/repo" -v "$PWD/runs:/runs" openstudio-mcp:dev bash -lc 'cd /repo && pytest -vv -m "not integration"'
- name: Smoke-install telemetry extra
# Validates that traceloop-sdk and its deps install cleanly from the
# pinned constraint in [telemetry]. Catches packaging drift that would
# make openstudio-mcp[telemetry] uninstallable without needing a full
# Docker rebuild.
run: |
docker run --rm -v "$PWD:/repo" openstudio-mcp:dev bash -lc \
'pip install --quiet -e "/repo[telemetry]" && python -c "from traceloop.sdk import Traceloop; print(\"traceloop-sdk OK\")"'
- name: Save Docker image
run: docker save openstudio-mcp:dev | gzip > /tmp/image.tar.gz
- uses: actions/upload-artifact@v4
with:
name: docker-image
path: /tmp/image.tar.gz
retention-days: 1
test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: docker-image
path: /tmp
- name: Load Docker image
run: docker load < /tmp/image.tar.gz
- name: Run tests (shard ${{ matrix.shard }})
env:
RUN_OPENSTUDIO_INTEGRATION: "1"
MCP_SERVER_CMD: "openstudio-mcp"
run: |
mkdir -p runs
case ${{ matrix.shard }} in
1)
# sim test + component/weather + loop ops + skill_retrofit
FILES="tests/test_example_workflows.py tests/test_component_properties.py tests/test_comstock.py tests/test_weather.py tests/test_weather_files.py tests/test_mcp_seb4.py tests/test_create_constructions.py tests/test_loop_operations.py tests/test_plant_loop_demand.py tests/test_sizing_properties.py tests/test_skill_retrofit.py tests/test_integration.py"
EXTRA_ENV="-e MCP_OSW_PATH=tests/assets/SEB_model/SEB4_baseboard/workflow.osw -e EXPECTED_EUI=1.8750760248144998 -e EXPECTED_EUI_RTOL=0.02 -e EXPECTED_EUI_ATOL=0.0"
;;
2)
# common_measures, hvac_systems, geometry, zone terminal, skill_energy_report
FILES="tests/test_common_measures.py tests/test_hvac_systems.py tests/test_replace_zone_terminal.py tests/test_geometry.py tests/test_skill_energy_report.py"
EXTRA_ENV=""
;;
3)
# controls, object mgmt, loads, building, doas, hvac, measures, measure_authoring, skill_qaqc, hvac_supply_wiring
FILES="tests/test_component_controls.py tests/test_object_management.py tests/test_generic_access.py tests/test_create_loads.py tests/test_building.py tests/test_doas_system.py tests/test_hvac.py tests/test_measures.py tests/test_measure_authoring.py tests/test_skill_qaqc.py tests/test_hvac_supply_wiring.py tests/test_validate_model.py tests/test_api_reference.py"
EXTRA_ENV=""
;;
4)
# vrf, radiant, query skills, creation, air terminals, results extraction
FILES="tests/test_vrf_system.py tests/test_radiant_system.py tests/test_loads.py tests/test_spaces.py tests/test_space_types.py tests/test_schedules.py tests/test_constructions.py tests/test_create_space.py tests/test_create_thermal_zone.py tests/test_add_air_loop.py tests/test_create_schedule_ruleset.py tests/test_add_output_variable.py tests/test_add_output_meter.py tests/test_load_save_model.py tests/test_versions.py tests/test_create_example_osm.py tests/test_inspect_osm_summary.py tests/test_copy_file.py tests/test_replace_air_terminals.py tests/test_results_extraction.py tests/test_swig_memleak_cleanup.py tests/test_skill_tools_integration.py tests/test_stdio_smoke.py tests/test_response_sizes.py"
EXTRA_ENV=""
;;
5)
# HVAC supply sim smoke tests + hvac_validation + bar_building + concurrent regression + telemetry
FILES="tests/test_hvac_supply_sim.py tests/test_hvac_validation.py tests/test_bar_building.py tests/test_concurrent_tools.py tests/test_stdout_logger_silence.py tests/test_telemetry.py"
EXTRA_ENV=""
;;
esac
docker run --rm \
-v "$PWD:/repo" -v "$PWD/runs:/runs" \
-e RUN_OPENSTUDIO_INTEGRATION -e MCP_SERVER_CMD \
$EXTRA_ENV \
openstudio-mcp:dev bash -lc "cd /repo && pytest -vv -s $FILES"