-
Notifications
You must be signed in to change notification settings - Fork 23
145 lines (130 loc) · 4.51 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
# All actions have a name that will be displayed in the "Actions" page in GitHub.
name: Continuous integration for Nomad and PyNomad
# Controls when the action will run.
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "nomad"
nomad:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows -- VS2022", artifact: "Windows_VS2022.tar.xz",
os: windows-latest,
build_type: "Release", cc: "cl", cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
}
# - {
# name: "Windows -- MinGW", artifact: "Windows-MinGW.tar.xz",
# os: windows-latest,
# build_type: "Release", cc: "x86_64-w64-mingw32-gcc", cxx: "x86_64-w64-mingw32-g++"
# }
- {
name: "Ubuntu", artifact: "Linux.tar.xz",
os: ubuntu-latest,
build_type: "Release", cc: "gcc", cxx: "g++"
}
- {
name: "MacOS", artifact: "macOS.tar.xz",
os: macos-latest,
build_type: "Release", cc: "clang", cxx: "clang++"
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Usually this is always needed
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Prepare Python environment
run: >-
pip install setuptools wheel cython pytest
- name: Install dependencies on Windows
if: startsWith(matrix.config.name, 'Windows')
run: |
choco install cmake
cmake --version
- name: Install dependencies on Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
run: |
sudo apt-get update
sudo apt-get install cmake
cmake --version
gcc --version
- name: Install dependencies on MacOS
if: startsWith(matrix.config.name, 'MacOS')
run: |
brew install cmake
cmake --version
- name: Configure on LinuxType
if: startsWith(matrix.config.name, 'MacOS') || startsWith(matrix.config.name, 'Ubuntu')
shell: bash
run: |
mkdir instdir
mkdir build
cd build
cmake \
-DCMAKE_CC_COMPILER=${{matrix.config.cc}} \
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} \
-DBUILD_TESTS=ON \
-DBUILD_INTERFACE_C=ON \
-DBUILD_INTERFACE_PYTHON=ON \
-DTEST_OPENMP=OFF \
-DCMAKE_INSTALL_PREFIX=../instdir \
..
- name: Configure on WindowsType
if: startsWith(matrix.config.name, 'Windows')
shell: bash
run: |
mkdir instdir
mkdir build
cd build
if [[ "${{matrix.config.name}}" == "Windows -- MinGW" ]]; then
cmake -G "MinGW Makefiles" \
-DTEST_OPENMP=OFF \
-DBUILD_INTERFACE_C=ON \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX=../instdir \
..
else
cmake .. -DTEST_OPENMP=OFF -DBUILD_INTERFACE_C=ON -DBUILD_INTERFACE_PYTHON=ON -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=../instdir
fi
- name: Build
shell: bash
run: |
cmake --build build --config ${{matrix.config.build_type}} --clean-first --parallel 2
- name: Install
shell: bash
run: |
cmake --install build --config ${{matrix.config.build_type}}
- name: Tests
shell: bash
run: |
export PATH=`pwd`/build/bin:$PATH
echo $PATH
cd build
ctest -C ${{matrix.config.build_type}} -E outputqueue_unittestname --output-on-failure
- name: Test (PyNomad wheel)
shell: bash
run: |-
cd interfaces/PyNomad
pip install --force-reinstall dist/*.whl
pytest
- name: Prepare upload
shell: bash
run: |
mv README.txt instdir/.
mv LICENSE instdir/.
cd instdir
tar -cf NOMAD4.tar *
- name: Upload
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.os }}
path: instdir/NOMAD4.tar