11name : CI
22
3- on : [pull_request]
3+ on :
4+ push :
5+ pull_request :
6+ workflow_dispatch :
7+
8+ defaults :
9+ run :
10+ shell : bash
411
512jobs :
613 external_c_checks :
714 timeout-minutes : 5
815 runs-on : ubuntu-latest
916 steps :
10- - uses : actions/checkout@v3
17+ - name : Checkout code
18+ uses : actions/checkout@v4
1119 with :
1220 fetch-depth : 5
13- - name : Build libraries
21+ - name : Configure
1422 run : |
1523 rm -rf Modelica/Resources/Library/*
1624 mkdir -p Modelica/Resources/Library/$LIBDIR
1725 pushd Modelica/Resources/BuildProjects/autotools
1826 git clean -fdx .
1927 ./autogen.sh
20- ./configure --libdir="$PWD/../../Library/$LIBDIR" --enable-static --disable-shared --enable-static-zlib --disable-hdf5 CPPFLAGS="-I${GITHUB_WORKSPACE}/.CI/Test"
28+ ./configure --libdir="$PWD/../../Library/$LIBDIR" --enable-static --disable-shared --enable-static-zlib --disable-hdf5
29+ popd
30+ env :
31+ LIBDIR : linux64
32+ - name : Build
33+ run : |
34+ pushd Modelica/Resources/BuildProjects/autotools
2135 make --output-sync
2236 sudo make install
2337 popd
@@ -30,15 +44,107 @@ jobs:
3044 env :
3145 LIBDIR : linux64
3246 CC : gcc
47+
48+ external_c_checks_cmake :
49+ name : external_c_checks_cmake_${{ matrix.toolchain }}
50+ runs-on : ${{ matrix.os }}
51+ timeout-minutes : 5
52+ strategy :
53+ matrix :
54+ toolchain :
55+ - linux-gcc
56+ - macos-clang
57+ - windows-msvc
58+ - windows-mingw
59+ configuration :
60+ - Debug
61+ include :
62+ - toolchain : linux-gcc
63+ os : ubuntu-latest
64+ compiler : gcc
65+ - toolchain : macos-clang
66+ os : macos-latest
67+ compiler : clang
68+ - toolchain : windows-msvc
69+ os : windows-latest
70+ compiler : msvc
71+ - toolchain : windows-mingw
72+ os : windows-latest
73+ compiler : mingw
74+ steps :
75+ - name : Checkout code
76+ uses : actions/checkout@v4
77+ with :
78+ fetch-depth : 5
79+ - name : Configure
80+ run : |
81+ if [ "${{ matrix.compiler }}" == "msvc" ]; then
82+ cmake -S "$SRCDIR" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON
83+ elif [ "${{ matrix.compiler }}" == "mingw" ]; then
84+ cmake -S "$SRCDIR" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -G "MinGW Makefiles"
85+ else
86+ cmake -S "$SRCDIR" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_FLAGS="-std=c89 -Wall -Wextra"
87+ fi
88+ env :
89+ SRCDIR : ${{ github.workspace }}/Modelica/Resources
90+ - name : Build with ${{ matrix.compiler }}
91+ run : |
92+ if [ "${{ matrix.compiler }}" == "msvc" ]; then
93+ cmake --build build --config ${{ matrix.configuration }}
94+ else
95+ cmake --build build -- -j8
96+ fi
97+ - name : Run tests
98+ run : ctest --no-tests=error --test-dir build --build-config ${{ matrix.configuration }} --verbose
99+
100+ external_c_checks_cmake_cygwin :
101+ name : external_c_checks_cmake_windows-cygwin
102+ runs-on : windows-latest
103+ timeout-minutes : 5
104+ steps :
105+ - name : Set git to use LF
106+ run : git config --global core.autocrlf input
107+ - name : Checkout code
108+ uses : actions/checkout@v4
109+ with :
110+ fetch-depth : 5
111+ - name : Setup cygwin
112+ uses : cygwin/cygwin-install-action@master
113+ with :
114+ packages : >-
115+ cmake
116+ gcc-core
117+ make
118+ ninja
119+ - name : Configure
120+ run : |
121+ export PATH=/usr/bin:$PATH
122+ cmake -S "$(cygpath ${SRCDIR})" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON -DCMAKE_BUILD_TYPE=Debug -G Ninja
123+ shell : C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
124+ env :
125+ CYGWIN_NOWINPATH : 1
126+ SRCDIR : ${{ github.workspace }}/Modelica/Resources
127+ - name : Build with gcc
128+ run : |
129+ export PATH=/usr/bin:$PATH
130+ cmake --build build -- -j8
131+ shell : C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
132+ - name : Run tests
133+ run : |
134+ export PATH=/usr/bin:$PATH
135+ ctest --no-tests=error --test-dir build --build-config Debug --verbose
136+ shell : C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
137+
33138 html_documentation_checks :
34139 timeout-minutes : 5
35140 runs-on : ubuntu-latest
36141 steps :
37- - uses : actions/checkout@v3
142+ - name : Checkout code
143+ uses : actions/checkout@v4
38144 with :
39145 fetch-depth : 5
40146 - name : Setup python environment
41- uses : actions/setup-python@v4
147+ uses : actions/setup-python@v5
42148 with :
43149 python-version : 3.8
44150 - name : Install python packages
49155 run : |
50156 git clone --branch 5.8.0 --depth=1 https://github.com/htacg/tidy-html5.git
51157 pushd tidy-html5
52- cmake .
158+ cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
53159 make
54160 sudo make install
55161 popd
@@ -64,11 +170,13 @@ jobs:
64170 echo "::add-matcher::./.github/checkTags.json"
65171 python ./.CI/check_html.py checkTags ./
66172 echo "::remove-matcher owner=checkTags::"
173+
67174 syntax_checks :
68175 timeout-minutes : 5
69176 runs-on : ubuntu-latest
70177 steps :
71- - uses : actions/checkout@v3
178+ - name : Checkout code
179+ uses : actions/checkout@v4
72180 with :
73181 fetch-depth : 5
74182 - name : Get moparser
@@ -80,17 +188,19 @@ jobs:
80188 - name : Check syntax
81189 run : |
82190 echo "::add-matcher::./.github/moparser.json"
83- ModelicaSyntaxChecker/Linux64/moparser -v 3.4 -r Complex.mo Modelica ModelicaReference ModelicaServices ModelicaTest ModelicaTestConversion4.mo ModelicaTestOverdetermined.mo ObsoleteModelica4.mo
191+ ModelicaSyntaxChecker/Linux64/moparser -v 3.6 -r Complex.mo Modelica ModelicaReference ModelicaServices ModelicaTest ModelicaTestConversion4.mo ModelicaTestOverdetermined.mo ObsoleteModelica4.mo
84192 echo "::remove-matcher owner=moparser::"
193+
85194 deprecation_checks :
86195 timeout-minutes : 5
87196 runs-on : ubuntu-latest
88197 steps :
89- - uses : actions/checkout@v3
198+ - name : Checkout code
199+ uses : actions/checkout@v4
90200 with :
91201 fetch-depth : 5
92202 - name : Setup python environment
93- uses : actions/setup-python@v4
203+ uses : actions/setup-python@v5
94204 with :
95205 python-version : 3.8
96206 - name : Check deprecated Text.lineColor annotation
0 commit comments