-
Notifications
You must be signed in to change notification settings - Fork 45
108 lines (95 loc) · 3.35 KB
/
run_tests.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
name: Run the tests
on: [pull_request]
env:
BUILD_FOLDER: build
EXAMPLES_FOLDER: examples
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
label: osx-64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: windows-latest
label: win-64
prefix: C:\Miniconda3\envs\ezc3d
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
activate-environment: ezc3d
environment-file: environment.yml
- name: Print mamba info
run: |
mamba info
mamba list
- name: Install extra common dependencies
run: |
mamba install cmake git pkgconfig swig numpy pytest -cconda-forge
mamba list
git submodule update --init --recursive
- name: Build ezc3d UNIX
run: |
MAIN_FOLDER=`pwd`
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $MAIN_FOLDER/$BUILD_FOLDER
cd $MAIN_FOLDER/$BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DBUILD_DOC=OFF -DBUILD_EXAMPLE=ON -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_OCTAVE=OFF -DBINDER_PYTHON3=ON ..
make install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label != 'win-64'
- name: Run tests UNIX
run: |
MAIN_FOLDER=`pwd`
cd $MAIN_FOLDER/$BUILD_FOLDER/test
./ezc3d_test
cd $MAIN_FOLDER
if: matrix.label != 'win-64'
- name: Build ezc3d WINDOWS
run: |
MAIN_FOLDER=`pwd`
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $BUILD_FOLDER
cd $BUILD_FOLDER
cmake -G"Visual Studio 17 2022" -Ax64 -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DBUILD_DOC=OFF -DBUILD_EXAMPLE=ON -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_OCTAVE=OFF -DBINDER_PYTHON3=ON ..
cmake --build . --config Release --target install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label == 'win-64'
- name: Run tests WINDOWS
run: |
MAIN_FOLDER=`pwd`
cd $MAIN_FOLDER/$BUILD_FOLDER/test
cp $MAIN_FOLDER/$BUILD_FOLDER/Release/*.dll .
cp $MAIN_FOLDER/$BUILD_FOLDER/bin/Release/*.dll .
cp Release/ezc3d_test.exe .
./ezc3d_test.exe
cd $MAIN_FOLDER
if: matrix.label == 'win-64'
- name: Run python binder tests
run: |
MAIN_FOLDER=`pwd`
cd $MAIN_FOLDER/$BUILD_FOLDER
pytest -v --color=yes $MAIN_FOLDER/test/python3
cd $MAIN_FOLDER
- name: Test installed version of python
run: |
MAIN_FOLDER=`pwd`
cd
python -c "import ezc3d"
cd $MAIN_FOLDER