Skip to content

Commit

Permalink
Add FMPy verification test (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren authored May 2, 2022
1 parent fe878f7 commit ba2389b
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 8 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
name: test-fmu-linux
path: fmu-builder/build/generated/Identity.fmu

test-external-linux:
check-linux:
needs: [build-linux]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jvm-version: [ 8 ]
jvm-version: [ 8, 11 ]

steps:
- uses: actions/checkout@v2
Expand All @@ -53,7 +53,7 @@ jobs:
java-version: ${{matrix.jvm-version}}
distribution: 'adopt'

- name: Download fmus
- name: Download FMUs
uses: actions/download-artifact@v2
with:
name: test-fmu-linux
Expand All @@ -63,6 +63,47 @@ jobs:
run: |
wget https://github.com/modelica-tools/FMUComplianceChecker/releases/download/2.0.4/FMUChecker-2.0.4-linux64.zip
7z x FMUChecker-2.0.4-linux64.zip && cd FMUChecker-2.0.4-linux64
export LD_LIBRARY_PATH="${{env.JAVA_HOME}}/lib/server:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH="${{env.JAVA_HOME}}/jre/lib/amd64/server:${LD_LIBRARY_PATH}"
./fmuCheck.linux64 ../fmu-builder/build/generated/Identity.fmu
shell: bash

fmpy-linux:
needs: [ build-linux ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jvm-version: [ 8, 11 ]
python-version: [ 3.7, 3.8, 3.9 ]

steps:
- uses: actions/checkout@v2

- name: Setup Python ${{matrix.python-version}}
uses: actions/setup-python@v3
with:
python-version: ${{matrix.python-version}}

- name: Set up JDK ${{matrix.jvm-version}}
uses: actions/setup-java@v2
with:
java-version: ${{matrix.jvm-version}}
distribution: 'adopt'

- name: Download FMUs
uses: actions/download-artifact@v2
with:
name: test-fmu-linux
path: fmu-builder/build/generated/

- name: Install FMPy
run: |
pip install fmpy
- name: Test FMPy
run: |
cd verification
export LD_LIBRARY_PATH="${{env.JAVA_HOME}}/lib/server:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH="${{env.JAVA_HOME}}/jre/lib/amd64/server:${LD_LIBRARY_PATH}"
python fmpy_test.py
53 changes: 50 additions & 3 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
${{ runner.os }}-gradle-
- name: Set up JDK ${{matrix.jvm-version}}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: ${{matrix.jvm-version}}
distribution: 'adopt'

- name: Build
run: ./gradlew clean buildNative build
Expand All @@ -35,13 +36,13 @@ jobs:
name: test-fmu-win
path: fmu-builder/build/generated/Identity.fmu

test-external-windows:
check-windows:
needs: [build-windows]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
jvm-version: [ 8 ]
jvm-version: [ 8, 11 ]

steps:
- uses: actions/checkout@v2
Expand All @@ -55,6 +56,7 @@ jobs:
- name: Setup PATH
run: |
echo "${{env.JAVA_HOME}}\bin" >> $GITHUB_PATH
echo "${{env.JAVA_HOME}}\bin\server" >> $GITHUB_PATH
echo "${{env.JAVA_HOME}}\jre\bin\server" >> $GITHUB_PATH
shell: bash

Expand All @@ -70,3 +72,48 @@ jobs:
7z x FMUChecker-2.0.4-win64.zip && cd FMUChecker-2.0.4-win64
./fmuCheck.win64.exe ../fmu-builder/build/generated/Identity.fmu
shell: bash

fmpy-windows:
needs: [ build-windows ]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
jvm-version: [ 8, 11 ]
python-version: [ 3.7 ]

steps:
- uses: actions/checkout@v2

- name: Setup Python ${{matrix.python-version}}
uses: actions/setup-python@v3
with:
python-version: ${{matrix.python-version}}

- name: Set up JDK ${{matrix.jvm-version}}
uses: actions/setup-java@v2
with:
java-version: ${{matrix.jvm-version}}
distribution: 'adopt'

- name: Setup PATH
run: |
echo "${{env.JAVA_HOME}}\bin" >> $GITHUB_PATH
echo "${{env.JAVA_HOME}}\bin\server" >> $GITHUB_PATH
echo "${{env.JAVA_HOME}}\jre\bin\server" >> $GITHUB_PATH
shell: bash

- name: Download FMUs
uses: actions/download-artifact@v2
with:
name: test-fmu-win
path: fmu-builder/build/generated/

- name: Install FMPy
run: |
pip install fmpy
- name: Test FMPy
run: |
cd verification
python fmpy_test.py
4 changes: 2 additions & 2 deletions .github/workflows/upload-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
${{ runner.os }}-gradle-
- name: Set up JDK ${{matrix.jvm-version}}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: ${{matrix.jvm-version}}
distribution: 'adopt'

- name: Build
run: ./gradlew shadowJar
shell: bash

- uses: actions/upload-artifact@v2
if: ${{matrix.jvm-version}} == 8
with:
name: fmu-builder
path: fmu-builder-app/build/libs/fmu-builder.jar

0 comments on commit ba2389b

Please sign in to comment.