Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .CI/ReSim/prepare_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
event_number=$1
# checkout the pull request
docker run --name compile_msl --rm --volume shared_data:/shared_data wsm_image /shared_data/run_scripts/git_pr_pull.sh $event_number
# compile msl binaries
docker run --name compile_msl --rm --volume shared_data:/shared_data wsm_image /shared_data/run_scripts/compile_msl.sh /shared_data/repos/pr_testing/ModelicaStandardLibrary
# delete old PRs with same number (in case of a new commit on a PR)
docker run --name compile_msl --rm --volume shared_data:/shared_data dymola_image /shared_data/run_scripts/delete_old_PRs.sh $event_number
33 changes: 33 additions & 0 deletions .CI/ReSim/run_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
event_number=$1
master_hash=$2
pkg_name=$3

# Run Modelica in all tools
tools=$4

for tool in $tools
do
uppertool=$tool | tr 'a-z' 'A-Z'
docker run --rm --name $tool\_pr_compare_$event_number\_$pkg_name --volume shared_data:/shared_data $tool\_image python /shared_data/run_scripts/$uppertool\_PR_compare.py $master_hash $event_number $pkg_name
done

#docker run --rm --name dymola_pr_compare_$event_number\_$pkg_name --volume shared_data:/shared_data dymola_image python /shared_data/run_scripts/Dymola_PR_compare.py $master_hash $event_number $pkg_name
#docker run --rm --name om_pr_compare_$event_number\_$pkg_name --volume shared_data:/shared_data om_image python /shared_data/run_scripts/OM_PR_compare.py $master_hash $event_number $pkg_name
#docker run --rm --name wsm_pr_compare_$event_number\_$pkg_name --volume shared_data:/shared_data wsm_image python /shared_data/run_scripts/WSM_PR_compare.py $master_hash $event_number $pkg_name

# create an overview over all tools
docker run --name create_overview_$event_number\_$pkg_name --volume shared_data:/shared_data om_image python /shared_data/run_scripts/overview_report.py $event_number $pkg_name

# clear published directory (web server)
if [ -d "/var/www/html/prs/$event_number/$pkg_name" ]; then
rm -rf "/var/www/html/prs/$event_number/$pkg_name"
fi
if [ ! -d "/var/www/html/prs/$event_number" ]; then
mkdir /var/www/html/prs/$event_number
fi
mkdir /var/www/html/prs/$event_number/$pkg_name

# copy data to webserver directory
docker cp create_overview_$event_number\_$pkg_name:/shared_data/resim_output/PRs/PR_$event_number/$pkg_name/report /var/www/html/prs/$event_number/$pkg_name
docker rm create_overview_$event_number\_$pkg_name
exit $(head -n 1 /var/www/html/prs/$event_number/$pkg_name/status.txt)
43 changes: 43 additions & 0 deletions .github/workflows/ReSim_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI ReSim

on:
pull_request_target:
workflow_dispatch:

env:
PR_SERVER: ${{ vars.LTX_PR_SERVER }}
TESTING_TOOLS: ${{ vars.LTX_TESTING_TOOLS }}
EVENT_NUMBER: ${{ github.event.number }}
PR_SHA: ${{ github.event.pull_request.base.sha }}

jobs:
prepare:
runs-on: [ self-hosted, Linux, regression_testing ]
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: './.CI/ReSim'

- name: Checkout code in docker
run: ./.CI/ReSim/prepare_pr.sh ${{ env.EVENT_NUMBER }}

testrun_modelica:
needs: prepare
runs-on: [ self-hosted, Linux, regression_testing ]
environment:
name: Report modelica
url: ${{ env.PR_SERVER }}/${{ env.EVENT_NUMBER }}/Modelica/report/PR_comparison_report.html
steps:
- name: Run tests modelica
run: ./.CI/ReSim/run_pr.sh ${{ env.EVENT_NUMBER }} ${{ env.PR_SHA }} Modelica ${{ env.TESTING_TOOLS }}


testrun_modelicatest:
needs: prepare
runs-on: [ self-hosted, Linux, regression_testing ]
environment:
name: Report modelicatest
url: ${{ env.PR_SERVER }}/${{ env.EVENT_NUMBER }}/ModelicaTest/report/PR_comparison_report.html
steps:
- name: Run tests modelicatest
run: ./.CI/ReSim/run_pr.sh ${{ env.EVENT_NUMBER }} ${{ env.PR_SHA }} ModelicaTest ${{ env.TESTING_TOOLS }}
8 changes: 4 additions & 4 deletions Modelica/Blocks/Sources.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ parameter Real table[:, <strong>2</strong>]=[0, 0; 1, 1; 2, 4];
"Table look-up with respect to time and various interpolation and extrapolation methods (data from matrix/file)"
import Modelica.Blocks.Tables.Internal;
extends Modelica.Blocks.Interfaces.MO(final nout=max([size(columns, 1); size(offset, 1)]));
parameter Boolean tableOnFile=false
parameter Boolean tableOnFile = false
"= true, if table is defined on file or in function usertab"
annotation (Dialog(group="Table data definition"));
parameter Real table[:, :] = fill(0.0, 0, 2)
Expand All @@ -1606,8 +1606,8 @@ parameter Real table[:, <strong>2</strong>]=[0, 0; 1, 1; 2, 4];
caption="Open file in which table is present")));
parameter String delimiter="," "Column delimiter character for CSV file"
annotation (Dialog(
group="Table data definition",
enable=tableOnFile and isCsvExt),
group = "Table data definition",
enable = tableOnFile and isCsvExt),
choices(choice=" " "Blank", choice="," "Comma", choice="\t" "Horizontal tabulator", choice=";" "Semicolon"));
parameter Integer nHeaderLines=0 "Number of header lines to ignore for CSV file"
annotation (Dialog(group="Table data definition",enable=tableOnFile and isCsvExt));
Expand All @@ -1618,7 +1618,7 @@ parameter Real table[:, <strong>2</strong>]=[0, 0; 1, 1; 2, 4];
"Columns of table to be interpolated"
annotation (Dialog(group="Table data interpretation",
groupImage="modelica://Modelica/Resources/Images/Blocks/Sources/CombiTimeTable.png"));
parameter Modelica.Blocks.Types.Smoothness smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments
parameter Modelica.Blocks.Types.Smoothness smoothness = Modelica.Blocks.Types.Smoothness.LinearSegments
"Smoothness of table interpolation"
annotation (Dialog(group="Table data interpretation"));
parameter Modelica.Blocks.Types.Extrapolation extrapolation=Modelica.Blocks.Types.Extrapolation.LastTwoPoints
Expand Down
Loading