-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/develop' into crankcaseH…
…eater
- Loading branch information
Showing
273 changed files
with
20,681 additions
and
16,389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: epJSON dependency | ||
|
||
on: | ||
push | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
release: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Setup | ||
shell: bash | ||
run: | | ||
cmake -E make_directory ./build/ | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "Setting CMAKE_GENERATOR options equivalent to ='-G \"Visual Studio 17 2022\" -A x64'" | ||
echo CMAKE_GENERATOR='Visual Studio 17 2022' >> $GITHUB_ENV | ||
echo CMAKE_GENERATOR_PLATFORM=x64 >> $GITHUB_ENV | ||
choco install ninja | ||
fi; | ||
- name: Configure CMake | ||
working-directory: ./build | ||
run: | | ||
cmake ../ | ||
- name: Test epjson | ||
shell: python | ||
run: | | ||
from pathlib import Path | ||
import subprocess | ||
EP_ROOT = Path(".").resolve() | ||
EP_BUILD_DIR = Path('./build').resolve() | ||
EXPECTED_MSGS = ["Generating the epJSON schema!", "Generating the **embedded** epJSON schema"] | ||
def build(): | ||
lines = subprocess.check_output( | ||
[ | ||
"cmake", | ||
"--build", | ||
str(EP_BUILD_DIR), | ||
"--config", | ||
"Release", | ||
"--target", | ||
"embedded_epjson_source", | ||
], | ||
encoding="utf-8", | ||
stderr=subprocess.STDOUT, | ||
).splitlines() | ||
return lines | ||
IDD_IN = EP_ROOT / "idd/Energy+.idd.in" | ||
assert IDD_IN.exists() | ||
def ensure_target_built(lines, msg): | ||
breakpoint | ||
lines = [x.strip() for x in lines if "epJSON schema" in x] | ||
errors = [] | ||
for expected_msg in EXPECTED_MSGS: | ||
n = lines.count(expected_msg) | ||
if n != 1: | ||
errors.append(f"Expected 1 occurrence of '{expected_msg}', got {n}") | ||
assert not errors, "\n -" + "\n -".join(errors) | ||
# Build: first time: we get both | ||
lines = build() | ||
ensure_target_built(lines, "Failed on first build") | ||
# Insert a fake IDD change, we should also get both | ||
with open(IDD_IN, "r") as f: | ||
lines = f.read().splitlines() | ||
ori_lines = lines.copy() | ||
for i, line in enumerate(lines): | ||
if line.startswith(r"\group"): | ||
lines.insert(i + 1, "") | ||
lines.insert(i + 2, "FakeObject,") | ||
lines.insert(i + 3, r" A1; \field Name") | ||
break | ||
with open(IDD_IN, "w") as f: | ||
f.write("\n".join(lines) + "\n") | ||
lines = build() | ||
ensure_target_built(lines, "Failed after IDD change") | ||
with open(IDD_IN, "w") as f: | ||
f.write("\n".join(ori_lines) + "\n") | ||
lines = build() | ||
ensure_target_built(lines, "Failed after IDD change revert") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
20de981
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crankcaseHeater (mjwitte) - x86_64-MacOS-10.17-clang-13.0.0: OK (3447 of 3447 tests passed, 2 test warnings)
Messages:\n
20de981
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crankcaseHeater (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2672 of 2672 tests passed, 0 test warnings)
20de981
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crankcaseHeater (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3488 of 3488 tests passed, 2 test warnings)
Messages:\n
20de981
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crankcaseHeater (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1897 of 1897 tests passed, 0 test warnings)
20de981
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crankcaseHeater (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (778 of 778 tests passed, 0 test warnings)