-
Notifications
You must be signed in to change notification settings - Fork 6
158 lines (153 loc) · 5.13 KB
/
testing.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
# Workflow for testing meshpy
name: Test meshpy
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
type: choice
env:
# Indicated the testing script, that it is performed on GitHub. In this
# case all test have to pass.
TESTING_GITHUB: 1
# Some tests require the 4C executable to check if the created input file
# works with 4C.
MESHPY_FOUR_C_EXE: /home_local/github-runner/testing_lib/four_c_master/release/4C
# Python executable and virtual environment name
PYTHON_EXE: python3
PYTHON_VENV: python-testing-environment
# Meshpy can interact with cubitpy, to perform the corresponding tests,
# the following paths have to be set
CUBITPY_REPO: /home_local/github-runner/testing_lib/cubitpy_main
FOUR_C_PRE_EXODUS: /home_local/github-runner/testing_lib/four_c_master/release/pre_exodus
CUBIT_ROOT: /imcs/public/compsim/opt/cubit-15.2
# Meshpy allows to perform geometric search functions with ArborX,
# for this functionality we need Kokkos. On IMCS Ares this is provided
# with the spack installation under the following path.
SPACK_ACTIVATION_SCRIPT: /home_local/github-runner/testing_lib/spack/share/spack/setup-env.sh
jobs:
meshpy-testing:
name: meshpy-testing
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Test meshpy
run: |
whoami
pwd
MESHPY_PATH=$(pwd)
echo "Value of MESHPY_FOUR_C_EXE: \"${MESHPY_FOUR_C_EXE}\""
# Load the python interpreter
. ${SPACK_ACTIVATION_SCRIPT}
spack load [email protected]
# Create the virtual environment
${PYTHON_EXE} -m venv ${PYTHON_VENV}
source ${PYTHON_VENV}/bin/activate
# We have to update pip, otherwise there is a bug in the compilation of the cython code
pip install --upgrade pip
# Install meshpy
pip install .[CI-CD]
# Check git configuration
git config --list
# Install cubitpy
cd $CUBITPY_REPO
git checkout main
git pull
pip install .
cd $MESHPY_PATH
# Print information on the python environment
python --version
pip list
# Run tests
cd tests
coverage run --rcfile=coverage.config testing_main.py
coverage html
coverage report
coverage-badge -o htmlcov/coverage.svg
# Check codestyle
cd $MESHPY_PATH
black . --check --exclude="${PYTHON_VENV}" && exit 0
# If we did not exit earlier, raise an error here
exit 1
ls
geometric-search-testing:
name: geometric-search-testing
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Additionally test the geometric search module with ArborX
run: |
whoami
pwd
MESHPY_PATH=$(pwd)
# Load the external modules
git submodule update --init
# Load the required packages via spack
. ${SPACK_ACTIVATION_SCRIPT}
spack load [email protected]
spack load [email protected]
spack load [email protected]
spack load [email protected]
# Build the binaries
mkdir -p build/arborx
cd build/arborx
cmake ../../meshpy/geometric_search/src -G Ninja
ninja
cd $MESHPY_PATH
# Create the virtual environment
${PYTHON_EXE} -m venv ${PYTHON_VENV}
source ${PYTHON_VENV}/bin/activate
# We have to update pip, otherwise there is a bug in the compilation of the cython code
pip install --upgrade pip
# Install meshpy, it is not yet possible to globally install the ArborX binaries, so we
# use the developement mode here.
pip install -e .
# Print information on the python environment
python --version
pip list
# Run tests
cd tests
python3 testing_geometric_search.py
performance-test:
name: meshpy-performance-testing
runs-on: self-hosted
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Performace test
run: |
whoami
pwd
MESHPY_PATH=$(pwd)
# Load the python interpreter
. ${SPACK_ACTIVATION_SCRIPT}
spack load [email protected]
# Create the virtual environment
${PYTHON_EXE} -m venv ${PYTHON_VENV}
source ${PYTHON_VENV}/bin/activate
# We have to update pip, otherwise there is a bug in the compilation of the cython code
pip install --upgrade pip
# Install meshpy
pip install .
# Install cubitpy
cd $CUBITPY_REPO
git pull
pip install .
cd $MESHPY_PATH
# Print information on the python environment
python --version
pip list
# Run performance tests
cd tests
python3 performance_testing.py