ASTE CI #711
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: ASTE CI | |
on: | |
push: | |
branches: [master, develop] | |
pull_request: | |
branches: [master, develop] | |
schedule: | |
- cron: '0 8 * * 2' # run once in a week (here Tue at 8am) | |
concurrency: | |
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{github.event_name == 'pull_request'}} | |
jobs: | |
vtk: | |
name: Build VTK from source | |
runs-on: ubuntu-latest | |
container: | |
image: precice/precice:nightly | |
options: --shm-size=2gb | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
steps: | |
- name: Check VTK cache | |
id: cache-vtk | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-aste-vtk | |
path: | | |
/usr/local/include/vtk-*/ | |
/usr/local/lib/libvtk* | |
/usr/local/lib/cmake/vtk-*/ | |
/usr/local/bin/vtk* | |
/usr/local/bin/pvtkpython | |
/usr/local/lib/python*/site-packages/vtk.py | |
/usr/local/lib/python*/site-packages/vtkmodules/* | |
/etc/profile.d/99-vtk.sh | |
- name: Build VTK | |
if: steps.cache-vtk.outputs.cache-hit != 'true' | |
run: | | |
git clone https://gitlab.kitware.com/vtk/vtk.git && cd vtk | |
git checkout v9.3.0 | |
mkdir build && cd build | |
cmake -DVTK_WRAP_PYTHON="ON" -DVTK_USE_MPI="ON" -DCMAKE_BUILD_TYPE=Release .. | |
cmake --build . && cmake --install . | |
echo 'export PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python3.10/site-packages/"' > /etc/profile.d/99-vtk.sh | |
build: | |
needs: vtk | |
name: ${{ format('{0} {1}', matrix.CXX, matrix.TYPE) }} | |
runs-on: ubuntu-latest | |
container: | |
image: precice/precice:nightly | |
options: --shm-size=2gb | |
defaults: | |
run: | |
shell: "bash --login -eo pipefail {0}" | |
strategy: | |
fail-fast: false | |
matrix: | |
CXX: ["clang++", "g++"] | |
TYPE: ["Debug", "Release"] | |
env: | |
CXX: ${{ matrix.CXX }} | |
CXX_FLAGS: "-Werror -Wall -Wextra -Wno-unused-parameter" | |
CTEST_OUTPUT_ON_FAILURE: "Yes" | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
steps: | |
- name: Restore VTK from cache | |
uses: actions/cache@v4 | |
with: | |
fail-on-cache-miss: true | |
key: ${{ runner.os }}-aste-vtk | |
path: | | |
/usr/local/include/vtk-*/ | |
/usr/local/lib/libvtk* | |
/usr/local/lib/cmake/vtk-*/ | |
/usr/local/bin/vtk* | |
/usr/local/bin/pvtkpython | |
/usr/local/lib/python*/site-packages/vtk.py | |
/usr/local/lib/python*/site-packages/vtkmodules/* | |
/etc/profile.d/99-vtk.sh | |
- name: setup system | |
run: | | |
apt-get -y update && apt-get -y upgrade | |
apt-get install -qq -y python3-pip python3-jinja2 python3-scipy python3-sympy libmetis-dev time clang | |
- uses: actions/checkout@v4 | |
- name: install example dependencies | |
run: | | |
python3 -m pip install -r requirements.txt | |
- name: prepare build directory | |
run: | | |
mkdir build | |
- name: build aste | |
working-directory: build | |
run: | | |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.TYPE }} .. | |
cmake --build . | |
- name: Adjust user rights | |
run: chown -R precice . | |
- name: run test | |
working-directory: build | |
run: | | |
su -c "ctest" precice |