Skip to content

CI

CI #615

Workflow file for this run

name: CI
on:
schedule:
- cron: "20 3 * * *"
push:
pull_request:
workflow_dispatch:
jobs:
build-linux:
strategy:
matrix:
config: ["Debug", "Release"]
os: ["ubuntu-latest", "ubuntu-20.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y cmake cmake-data gfortran libcurl4-openssl-dev libxslt1-dev python3-setuptools
sudo python3 -m pip install conan
- name: Build TiXI
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DBUILD_SHARED_LIBS=ON \
-DTIXI_BUILD_TESTS=ON \
-DTIXI_ENABLE_FORTRAN=ON \
..
make -j
- name: Upload build directory
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}-${{ matrix.config }}
path: build
retention-days: 1
- name: Build conan package
run: |
conan profile detect
conan create . --build=missing -o 'tixi3/*:shared=True' -s build_type=${{ matrix.config }}
build-win64:
strategy:
matrix:
config: ["Debug", "Release"]
os: ["windows-2019", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
# On the Github-hosted runner, git checks out text files with \r\n (I think)
# which messes up some unit tests, specifically UtilsTest.loadFileToString,
# which expects TestData/minimal.xml not to have any carriage returns \r.
# So we have to overwrite this checkout policy here:
- name: Set git to use LF instead of CRLF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
md c:\tixi-3rdparty -Force | Out-Null
If (!(Test-Path -Path "c:\tixi-3rdparty\tixi-3rdparty-vc2015-win64")) {
Write-Output "Downloading tixi 3rdparty libraries"
(new-object System.Net.WebClient).Downloadfile("https://sourceforge.net/projects/tixi/files/dev-tools/tixi-3rdparty-vc2015-win64.zip", "c:\tixi-3rdparty-vc2015-win64.zip")
Write-Output "Extract tixi 3rdparty libraries"
& 7z x -y "c:\tixi-3rdparty-vc2015-win64.zip" -oC:\tixi-3rdparty\ > null
}
If (!(Test-Path -Path "c:\tixi-3rdparty\matlab-libs-win")) {
Write-Output "Downloading matlab libraries"
(new-object System.Net.WebClient).Downloadfile("https://sourceforge.net/projects/tixi/files/dev-tools/matlab-libs-win.zip", "c:\matlab-libs-win.zip")
Write-Output "Extract matlab libraries"
& 7z x -y "c:\matlab-libs-win.zip" -oC:\tixi-3rdparty\ > null
}
- name: Setup msys2/gfortran
uses: msys2/setup-msys2@v2
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Build TiXI
shell: cmd /C call {0}
run: |
gfortran --version
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
-DTIXI_ENABLE_FORTRAN=ON ^
-DBUILD_SHARED_LIBS=ON ^
-DTIXI_BUILD_TESTS=ON ^
-DMATLAB_DIR=c:\tixi-3rdparty\matlab-libs-win ^
-DCMAKE_PREFIX_PATH='c:\tixi-3rdparty\tixi-3rdparty-vc2015-win64' ^
-DCMAKE_INSTALL_PREFIX=install ^
..
cmake --build . --target install --config ${{ matrix.config }}
- name: Upload build directory
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}-${{ matrix.config }}
path: build
retention-days: 1
test-linux:
strategy:
matrix:
config: ["Debug", "Release"]
os: ["ubuntu-latest", "ubuntu-20.04"]
runs-on: ${{ matrix.os }}
needs: build-linux
steps:
- name: Download build directory
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.os }}-${{ matrix.config }}
path: build
- name: Run unit tests
run: |
cd build/tests
chmod a+x TIXI-unittests
./TIXI-unittests
test-win64:
strategy:
matrix:
config: ["Debug", "Release"]
os: ["windows-2019", "windows-latest"]
runs-on: ${{ matrix.os }}
needs: build-win64
steps:
- name: Download build directory
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.os }}-${{ matrix.config }}
path: build
- name: Run unit tests
shell: cmd /C call {0}
run: |
set PATH=%cd%\build\install\bin;%cd%\build\lib\${{ matrix.config }};%cd%\build\bin\${{ matrix.config }};%PATH%
cd build\tests
.\${{ matrix.config }}\TIXI-unittests.exe --gtest_output=xml:test_results.xml
deploy-win64:
runs-on: "windows-2019"
needs: test-win64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download build directory
uses: actions/download-artifact@v4
with:
name: build-windows-2019-Release
path: build
- name: Artifact installer and zip
run: |
cd build
cmake --build .. --config Release --target doc
& 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP
& 'C:\Program Files\CMake\bin\cpack.exe' -G NSIS
- name: Upload installer as artifact
uses: actions/upload-artifact@v4
with:
name: win64-installer
path: build/*.exe
- name: Upload package as artifact
uses: actions/upload-artifact@v4
with:
name: win64-package
path: build/*.zip
- name: Upload documentation as artifact
uses: actions/upload-artifact@v4
with:
name: html-documentation
path: build/doc/html/*