-
-
Notifications
You must be signed in to change notification settings - Fork 12
105 lines (101 loc) · 3.27 KB
/
aste_ci.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
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