-
Notifications
You must be signed in to change notification settings - Fork 31
209 lines (201 loc) · 7.24 KB
/
checkCI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: CI
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build_linux:
name: build_${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux32
- linux64
include:
- platform: linux32
cflags: "-O3 -DNDEBUG -fPIC -msse2 -m32"
- platform: linux64
cflags: "-O3 -DNDEBUG -fPIC"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Build with gcc
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:16.04 bash -c "
dpkg --add-architecture i386 &&
apt-get update &&
apt-get install -y software-properties-common libc6-dev-i386 gcc-multilib g++-multilib build-essential &&
add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
apt-get update &&
apt-get install -y gcc-4.8 g++-4.8 &&
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10 &&
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10 &&
pushd ExternData/Resources/C-Sources &&
make CFLAGS=\"${{ matrix.cflags }}\" CXXFLAGS=\"${{ matrix.cflags }}\" TARGETDIR=\"${{ matrix.platform }}\"
"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ExternData_${{ matrix.platform }}
path: ExternData/Resources/Library/${{ matrix.platform }}/*.a
build_mingw64:
name: build_mingw64
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install HDF5
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-hdf5 mingw-w64-x86_64-pkgconf
- name: Build with gcc
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
pushd ExternData/Resources/C-Sources
mingw32-make CC="gcc" CFLAGS="-O3 -DNDEBUG" INC="-Ibsxml-json -Iexpat/lib -IC:\msys64\mingw64\include -Iinih -Ilibxls/include -Iminizip -Imodelica -Izlib -Iparson -Ilibxml2/include" TARGETDIR="mingw64"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ExternData_mingw64
path: ExternData/Resources/Library/mingw64/*.a
test:
name: test_cmake_${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- linux-gcc
- windows-msvc
- windows-mingw
configuration:
- Release
include:
- toolchain: linux-gcc
os: ubuntu-latest
compiler: gcc
- toolchain: windows-msvc
os: windows-latest
compiler: msvc
- toolchain: windows-mingw
os: windows-latest
compiler: mingw
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install HDF5
if: matrix.compiler == 'mingw'
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-hdf5 mingw-w64-x86_64-pkgconf
- name: Configure
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake -S "$SRCDIR" -B build
elif [ "${{ matrix.compiler }}" == "mingw" ]; then
cmake -S "$SRCDIR" -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_EXE_LINKER_FLAGS="-L/C:\msys64\mingw64\lib" -G "MinGW Makefiles"
else
cmake -S "$SRCDIR" -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_FLAGS="-Wall -Wextra"
fi
env:
SRCDIR: ${{ github.workspace }}/ExternData/Resources
- name: Build tests with ${{ matrix.compiler }}
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake --build build --config ${{ matrix.configuration }}
else
cmake --build build -- -j8
fi
- name: Run tests
if: matrix.compiler == 'mingw'
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
ctest --no-tests=error --test-dir build --build-config ${{ matrix.configuration }} --parallel 8
- name: Run tests
if: matrix.compiler != 'mingw'
run: ctest --no-tests=error --test-dir build --build-config ${{ matrix.configuration }} --parallel 8
html_documentation_checks:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Setup python environment
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install python packages
run: |
pip install --disable-pip-version-check --user pytidylib
pip install --disable-pip-version-check --user futures
- name: Build html tidy
run: |
git clone --branch 5.8.0 --depth=1 https://github.com/htacg/tidy-html5.git
pushd tidy-html5
cmake .
make
sudo make install
popd
sudo ldconfig
- name: Tidy html
run: |
echo "::add-matcher::./.github/tidyHTML.json"
python ./.CI/check_html.py tidyHTML ./
echo "::remove-matcher owner=tidyHTML::"
- name: Check tags
run: |
echo "::add-matcher::./.github/checkTags.json"
python ./.CI/check_html.py checkTags ./
echo "::remove-matcher owner=checkTags::"
syntax_checks:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Get moparser
run: git clone --depth=1 https://github.com/modelica-tools/ModelicaSyntaxChecker
- name: Check file encoding
run: "! find . -name '*.mo' -exec bash -c 'iconv -o /dev/null -f utf8 -t utf8 \"{}\" |& sed \"s,^,{}: ,\"' ';' | grep '.'"
- name: Check for UTF-8 BOM
run: "! find . -name '*.mo' -print0 | xargs -0 grep -l $'^\\xEF\\xBB\\xBF' | grep ."
- name: Check syntax
run: |
echo "::add-matcher::./.github/moparser.json"
ModelicaSyntaxChecker/Linux64/moparser -v 3.4 -r ExternData
echo "::remove-matcher owner=moparser::"
deprecation_checks:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Setup python environment
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Check deprecated Text.lineColor annotation
run: |
echo "::add-matcher::./.github/check_deprecated_line_color.json"
python ./.CI/check_deprecated_line_color.py ./
echo "::remove-matcher owner=check_deprecated_line_color::"