-
Notifications
You must be signed in to change notification settings - Fork 5
176 lines (152 loc) · 6.77 KB
/
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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Build & Test
#build and test on the three OS
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
# build-linux:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Build Ubuntu
# shell: bash -l {0}
# run: |
# sudo apt-get install libarmadillo-dev libboost-all-dev libmpfr-dev
# cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
# cmake --build ${{github.workspace}}/build
# ctest --test-dir ${{github.workspace}}/build
Linux:
name: Linux
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: foo
environment-file: environment.yml
- name: Build for Linux
shell: bash -l {0}
run: |
cmake -S . -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=$CONDA_PREFIX/include -DCMAKE_LIBRARY_PATH=$CONDA_PREFIX/lib -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -Wno-dev
cmake --build ${{github.workspace}}/build
cmake --install build --config Release
- name: Tests
shell: bash -l {0}
run: ctest --test-dir ${{github.workspace}}/build
- name: Build Python lib
shell: bash -l {0}
run: |
cmake -S simcoon-python-builder -B simcoon-python-builder/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=$CONDA_PREFIX/include -DCMAKE_LIBRARY_PATH=$CONDA_PREFIX/lib -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -Wno-dev
cmake --build simcoon-python-builder/build
cmake --install simcoon-python-builder/build --config Release
cp ${{github.workspace}}/simcoon-python-builder/build/lib/simmit.so ${{github.workspace}}/python-setup/simcoon/simmit.so
python -m pip install ${{github.workspace}}/python-setup
- name: Python tests
shell: bash -l {0}
run: ctest --test-dir ${{github.workspace}}/simcoon-python-builder/build
- name: Upload test logs as artifact
if: always() # Ensure this step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: test-logs-Linux
path: build/Testing/Temporary/LastTest.log
- name: Upload Python test logs as artifact
if: always() # Ensure this step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: test-logs-Python-Linux
path: simcoon-python-builder/build/Testing/Temporary/LastTest.log
MacOS:
name: MacOS
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: foo
environment-file: environment.yml
- name: Build for MacOS
shell: bash -l {0}
run: |
cmake -S . -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=$CONDA_PREFIX/include -DCMAKE_LIBRARY_PATH=$CONDA_PREFIX/lib -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -Wno-dev
cmake --build ${{github.workspace}}/build
cmake --install build --config Release
- name: Tests
shell: bash -l {0}
run: ctest --test-dir ${{github.workspace}}/build
- name: Build Python lib
shell: bash -l {0}
run: |
cmake -S simcoon-python-builder -B simcoon-python-builder/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=$CONDA_PREFIX/include -DCMAKE_LIBRARY_PATH=$CONDA_PREFIX/lib -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -Wno-dev
cmake --build simcoon-python-builder/build
cmake --install simcoon-python-builder/build --config Release
cp ${{github.workspace}}/simcoon-python-builder/build/lib/simmit.so ${{github.workspace}}/python-setup/simcoon/simmit.so
python -m pip install ${{github.workspace}}/python-setup
- name: Python tests
shell: bash -l {0}
run: ctest --test-dir ${{github.workspace}}/simcoon-python-builder/build
- name: Upload test logs as artifact
if: always() # Ensure this step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: test-logs-OSX
path: build/Testing/Temporary/LastTest.log
- name: Upload Python test logs as artifact
if: always() # Ensure this step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: test-logs-Python-OSX
path: simcoon-python-builder/build/Testing/Temporary/LastTest.log
Windows:
name: Windows
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: foo
environment-file: environment_win.yml
- name: Build for Windows
shell: pwsh
run: |
cmake -S . -B build `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_INSTALL_PREFIX="$env:CONDA_PREFIX/Library" `
-Wno-dev
cmake --build build --config Release
cmake --install build
- name: Tests
shell: pwsh
run: ctest --test-dir build -C Release --output-on-failure -VV
- name: Build Python lib
shell: pwsh
run: |
cmake -S simcoon-python-builder -B simcoon-python-builder/build `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_INSTALL_PREFIX="$env:CONDA_PREFIX/Library" `
-Wno-dev
cmake --build simcoon-python-builder/build --config Release
cmake --install simcoon-python-builder/build
copy ${{github.workspace}}/simcoon-python-builder/build/lib/simmit.pyd ${{github.workspace}}/python-setup/simcoon/simmit.pyd
python -m pip install ${{github.workspace}}/python-setup
- name: Python tests
shell: pwsh
run: ctest --test-dir ${{github.workspace}}/simcoon-python-builder/build -C Release --output-on-failure -VV
- name: Upload test logs as artifact
if: always() # Ensure this step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: test-logs-Win
path: build/Testing/Temporary/LastTest.log
- name: Upload Python test logs as artifact
if: always() # Ensure this step runs even if the tests fail
uses: actions/upload-artifact@v3
with:
name: test-logs-Python-Win
path: simcoon-python-builder/build/Testing/Temporary/LastTest.log