generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (139 loc) · 5.67 KB
/
build-and-test-macos.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
name: Build and Test (macos)
# Trigger the workflow on push or pull request
on:
push:
branches:
- 97-add-more-environments-to-test-in-ci
jobs:
build:
strategy:
fail-fast: false
matrix:
host: [
{ os: macos-latest, compiler: { name: clang, cc: clang, cxx: clang++ }, gcov: gcov },
{ os: macos-latest, compiler: { name: gcc12, cc: gcc-12, cxx: g++-12 }, gcov: gcov-12 }
]
vtk_version: [ 9.3.1 ]
runs-on: ${{ matrix.host.os }}
name: vt-tv build and test
env:
VTK_SRC_DIR: /opt/src/vtk
VTK_BUILD_DIR: /opt/build/vtk
VTK_CACHE_KEY: ${{ matrix.host.os }}-${{ matrix.host.compiler.name }}-vtk-${{ matrix.vtk_version }}
VT_TV_BUILD_DIR: /opt/build/vt-tv
VT_TV_TESTS_ENABLED: "ON"
VT_TV_COVERAGE_ENABLED: "ON"
VT_TV_OUTPUT_DIR: /var/vt-tv/output
VT_TV_ARTIFACTS_DIR: /tmp/artifacts
CC: ~
CXX: ~
steps:
- uses: actions/checkout@v4
- name: Set folder permissions
run: |
sudo mkdir -p ${{ env.VTK_SRC_DIR }} ${{ env.VTK_BUILD_DIR }}
sudo chown -R $(whoami) ${{ env.VTK_SRC_DIR }} ${{ env.VTK_BUILD_DIR }}
- name: Set environment variables
run: |
echo "CC=$(which ${{ matrix.host.compiler.cc }})" >> $GITHUB_ENV
echo "CXX=$(which ${{ matrix.host.compiler.cc }})" >> $GITHUB_ENV
- name: Install dependencies
run: |
brew update && brew install coreutils lcov && brew install xquartz --cask
- name: Load VTK from cache
id: vtk-cache
uses: actions/cache@v3
with:
path: |
${{ env.VTK_SRC_DIR }}
${{ env.VTK_BUILD_DIR }}
key: ${{ env.VTK_CACHE_KEY }}
- name: Setup VTK ${{ matrix.vtk_version }}
if: ${{steps.vtk-cache.outputs.cache-hit != 'true'}}
run: |
git clone --recursive --branch v${{ matrix.vtk_version }} https://gitlab.kitware.com/vtk/vtk.git ${{ env.VTK_SRC_DIR }}
cd ${{ env.VTK_SRC_DIR }}
cmake \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DBUILD_TESTING:BOOL=OFF \
-DVTK_OPENGL_HAS_OSMESA:BOOL=OFF \
-DVTK_DEFAULT_RENDER_WINDOW_OFFSCREEN:BOOL=OFF \
-DVTK_USE_X:BOOL=OFF \
-DVTK_USE_COCOA:BOOL=ON \
-DVTK_USE_SDL2:BOOL=OFF \
-DVTK_Group_Rendering:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=ON \
-S /opt/src/vtk -B ${{ env.VTK_BUILD_DIR }}
cmake --build ${{ env.VTK_BUILD_DIR }} -j$(nproc)
# - name: Build
# run: |
# cd ${{ github.workspace }}
# chmod +x ./ci/build.sh
# VTK_DIR=${{ env.VTK_BUILD_DIR }} \
# CC="${{ env.CC }}" \
# CXX="${{ env.CXX }}" \
# VT_TV_BUILD_DIR=${{ env.VT_TV_BUILD_DIR }} \
# VT_TV_TESTS_ENABLED=${{ env.VT_TV_TESTS_ENABLED }} \
# VT_TV_COVERAGE_ENABLED=${{ env.VT_TV_COVERAGE_ENABLED }} \
# GCOV=${{ matrix.host.gcov }}
# VT_TV_PYTHON_BINDINGS_ENABLED=OFF \
# VT_TV_WERROR_ENABLED=ON \
# ./build.sh
# - name: Test
# run: |
# cd ${{ github.workspace }}
# sudo \
# VT_TV_BUILD=OFF \
# VT_TV_RUN_TESTS=ON \
# VT_TV_BUILD_DIR=${{ env.VT_TV_BUILD_DIR }}
# ./build.sh
# - name: Build and Test Python bindings
# run: |
# # TODO: add conda
# # Activate conda environment
# # . /opt/conda/etc/profile.d/conda.sh && conda activate deves
# # Build
# # pip install PyYAML
# # pip install .
# # Test
# # python ./tests/test_bindings.py
# - name: Collect artifacts
# run: |
# # Add artifacts
# mkdir -p ${{ env.VT_TV_ARTIFACTS_DIR }}
# # > go to output directory
# pushd ${{ env.VT_TV_OUTPUT_DIR }}
# # > add the unit tests report artifact
# cp "junit-report.xml" ${{ env.VT_TV_ARTIFACTS_DIR }}/ || true
# # > add mesh files and png artifacts
# if [ -d "${{ env.VT_TV_OUTPUT_DIR }}" ]; then
# cp "${{ env.VT_TV_OUTPUT_DIR }}/"*".vtp" ${{ env.VT_TV_ARTIFACTS_DIR }}/
# cp "${{ env.VT_TV_OUTPUT_DIR }}/"*".png" ${{ env.VT_TV_ARTIFACTS_DIR }}/
# fi
# if [[ "${{ env.VT_TV_COVERAGE_ENABLED }}" == "ON" ]]; then
# # > add `coverage --list` file artifact
# lcov --list lcov_vt-tv_test_no_deps.info > ${{ env.VT_TV_ARTIFACTS_DIR }}/lcov-list-report.txt
# # > add total lines coverage file artifact (percentage of lines covered)
# # might be useful for generating later a badge in ci
# LCOV_SUMMARY=$(lcov --summary lcov_vt-tv_test_no_deps.info)
# LCOV_TOTAL_LINES_COV=$(echo $LCOV_SUMMARY | grep -E -o 'lines......: ([0-9.]+)*' | grep -o -E '[0-9]+.[0-9]+')
# echo $LCOV_TOTAL_LINES_COV > lcov-lines-total.txt
# cp lcov-lines-total.txt ${{ env.VT_TV_ARTIFACTS_DIR }}/
# fi
# popd
# # list artifacts dir content
# ls ${{ env.VT_TV_ARTIFACTS_DIR }}
# - name: Unit tests
# if: ${{ env.VT_TV_TESTS_ENABLED == 'ON' }}
# uses: phoenix-actions/test-reporting@v15
# with:
# name: Tests report
# path: ${{ env.VT_TV_ARTIFACTS_DIR }}/junit-report.xml
# reporter: java-junit
# output-to: step-summary
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: vt-tv-artifacts
# path: ${{ env.VT_TV_ARTIFACTS_DIR }}