Skip to content

feat(routines): add typed Rust source-claim projection #188

feat(routines): add typed Rust source-claim projection

feat(routines): add typed Rust source-claim projection #188

Workflow file for this run

name: verify
on:
push:
branches: [main]
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: cxf-library
- name: Read engine pin
id: pin
run: echo "rev=$(cat cxf-library/ENGINE_PIN)" >> "$GITHUB_OUTPUT"
- name: Read G36 source pins
id: g36-source-pins
run: |
echo "release=$(cat cxf-library/routines/g36/SOURCE_RELEASE_PIN)" >> "$GITHUB_OUTPUT"
echo "development=$(cat cxf-library/routines/g36/SOURCE_DEVELOPMENT_PIN)" >> "$GITHUB_OUTPUT"
- name: Checkout open-control engine at pin
uses: actions/checkout@v4
with:
repository: jscott3201/open-control-engine
ref: ${{ steps.pin.outputs.rev }}
path: open-control
- name: Checkout Modelica Buildings release source at pin
uses: actions/checkout@v4
with:
repository: lbl-srg/modelica-buildings
ref: ${{ steps.g36-source-pins.outputs.release }}
path: modelica-buildings-release
- name: Checkout Modelica Buildings development source at pin
uses: actions/checkout@v4
with:
repository: lbl-srg/modelica-buildings
ref: ${{ steps.g36-source-pins.outputs.development }}
path: modelica-buildings-development
- name: svg fitment lint
working-directory: cxf-library
run: python3 tools/lint/svg_fitment.py
- name: registry lint
working-directory: cxf-library
run: python3 tools/lint/registry.py
- name: point semantic lint
working-directory: cxf-library
run: python3 tools/lint/point_semantics.py
- name: Install routine schema lint dependencies
working-directory: cxf-library
run: python3 -m pip install --requirement tools/lint/requirements-routine-schemas.txt
- name: routine catalog lint
working-directory: cxf-library
run: |
python3 -m unittest discover -s tools/lint/tests -v
python3 tools/lint/routine_schemas.py
python3 tools/lint/routine_semantics.py
python3 tools/lint/routines.py
- name: Verify G36 source inventory
working-directory: cxf-library
run: |
python3 tools/lint/g36_source.py --check \
--release-root ../modelica-buildings-release \
--development-root ../modelica-buildings-development
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
cxf-library/tools/routine-compiler
cxf-library/tools/verify
- name: Test G36 declaration package
working-directory: cxf-library
run: cargo test --locked --manifest-path tools/routine-compiler/Cargo.toml
- name: Verify G36 release declarations
working-directory: cxf-library
run: cargo run --manifest-path tools/verify/Cargo.toml -- --g36-declarations ../modelica-buildings-release
- name: Verify routine library
working-directory: cxf-library
run: cargo run --manifest-path tools/verify/Cargo.toml -- --routines
- name: Lint and verify fault library
working-directory: cxf-library
run: |
cargo test --manifest-path tools/verify/Cargo.toml
cargo run --manifest-path tools/verify/Cargo.toml -- --all
- name: Test external dataset harness
working-directory: cxf-library
run: python3 -m unittest discover -s tools/dataset_harness/tests -v
- name: Replay original tiny FPU fixture through pinned engine
working-directory: cxf-library
run: |
python3 tools/dataset_harness/harness.py replay \
--adapter lbl-fpu \
--dataset tools/dataset_harness/tests/fixtures/lbl_fpu_tiny \
--rules FPB-0001,FPB-0002,FPB-0003,FPB-0004,FPB-0005,FPB-0006 \
--verifier tools/verify/target/debug/cxf-verify \
--output target/dataset-harness/ci-lbl-fpu-results.json
python3 -c 'import json; p="target/dataset-harness/ci-lbl-fpu-results.json"; d=json.load(open(p)); assert d["schema"] == "cxf-library/dataset-validation/v1"; assert d["summary"]["fault_free_alarm_samples"] == 0; assert d["summary"]["target_declared_rule_case_pairs"] == 1; assert d["summary"]["target_detected_rule_case_pairs"] == 1'