Update testsuite #150
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
name: CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
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 | |
test: | |
name: test_cmake_${{ matrix.toolchain }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
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: 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 }} -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 | |
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::" |