-
Notifications
You must be signed in to change notification settings - Fork 179
181 lines (177 loc) · 6.41 KB
/
main.yml
File metadata and controls
181 lines (177 loc) · 6.41 KB
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
177
178
179
180
181
name: GitHub CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
debug_unix:
name: Debug ${{ matrix.label }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- label: linux-x64
runner: ubuntu-22.04
with_optional: ON
conda_pkgs: c-compiler cxx-compiler cmake ninja boost-cpp tbb tbb-devel eigen nlopt ipopt
- label: linux-arm64
runner: ubuntu-22.04-arm
with_optional: OFF
conda_pkgs: c-compiler cxx-compiler cmake ninja boost-cpp tbb tbb-devel eigen
- label: macos-arm64
runner: macos-latest
with_optional: ON
conda_pkgs: c-compiler cxx-compiler libcxx cmake ninja boost-cpp tbb tbb-devel eigen nlopt ipopt
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
- name: Install dependencies
shell: bash
run: |
set -e
conda create -y -q -p "$HOME/local" ${{ matrix.conda_pkgs }}
- name: Configure
shell: bash
run: |
set -e
conda run -p "$HOME/local" cmake -S . -B build -G Ninja \
-DCMAKE_PREFIX_PATH="$HOME/local" \
-DCMAKE_BUILD_TYPE=Debug \
-DBoost_NO_BOOST_CMAKE=ON \
-DPAGMO_BUILD_TESTS=ON \
-DPAGMO_WITH_EIGEN3=ON \
-DPAGMO_WITH_NLOPT=${{ matrix.with_optional }} \
-DPAGMO_WITH_IPOPT=${{ matrix.with_optional }} \
-DPAGMO_ENABLE_IPO=ON
- name: Build
shell: bash
run: |
set -e
conda run -p "$HOME/local" cmake --build build --parallel
- name: Test
shell: bash
run: |
set -e
conda run -p "$HOME/local" ctest --test-dir build -VV --output-on-failure -j4
release_windows_x64:
name: Release windows-x64
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
- name: Configure
shell: powershell
run: |
conda create -y -q -p $env:USERPROFILE\local cmake ninja eigen nlopt ipopt boost-cpp tbb tbb-devel
conda run -p $env:USERPROFILE\local cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
-DCMAKE_PREFIX_PATH=$env:USERPROFILE\local `
-DCMAKE_INSTALL_PREFIX=$env:USERPROFILE\local `
-DBoost_NO_BOOST_CMAKE=ON `
-DPAGMO_BUILD_TESTS=ON `
-DPAGMO_WITH_EIGEN3=ON `
-DPAGMO_WITH_NLOPT=ON `
-DPAGMO_WITH_IPOPT=ON `
-DPAGMO_ENABLE_IPO=ON
- name: Build
shell: powershell
run: conda run -p $env:USERPROFILE\local cmake --build build --config Release --parallel
- name: Test
shell: powershell
run: |
$env:PATH = "$PWD\build\Release;$env:USERPROFILE\local\Library\bin;$env:USERPROFILE\local\bin;$env:PATH"
ctest --test-dir build -VV --output-on-failure -j4 -C Release
linux_coverage_docs:
name: Linux coverage + docs${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && ' and deploy' || '' }}
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
- name: Install dependencies
shell: bash
run: |
set -e
conda create -y -q -p "$HOME/local" \
c-compiler cxx-compiler cmake ninja boost-cpp tbb tbb-devel eigen nlopt ipopt \
python=3.10 sphinx=4.5.0 sphinx-book-theme breathe "doxygen<1.13" graphviz lcov
- name: Build and test (coverage, no torture)
shell: bash
run: |
set -e
conda run -p "$HOME/local" cmake -S . -B build -G Ninja \
-DCMAKE_PREFIX_PATH="$HOME/local" \
-DCMAKE_BUILD_TYPE=Debug \
-DBoost_NO_BOOST_CMAKE=ON \
-DPAGMO_BUILD_TESTS=ON \
-DPAGMO_WITH_EIGEN3=ON \
-DPAGMO_WITH_NLOPT=ON \
-DPAGMO_WITH_IPOPT=ON \
-DPAGMO_ENABLE_IPO=OFF \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
conda run -p "$HOME/local" cmake --build build --parallel
conda run -p "$HOME/local" ctest --test-dir build -VV --output-on-failure -j4 -E torture
- name: Generate coverage
shell: bash
run: |
set -e
GCOV=$(conda run -p "$HOME/local" bash -lc 'command -v x86_64-conda-linux-gnu-gcov || command -v aarch64-conda-linux-gnu-gcov || command -v gcov')
echo "Using gcov tool: $GCOV"
# Print gcov version to help debugging mismatch issues
if [ -n "$GCOV" ]; then
"$GCOV" --version || true
fi
conda run -p "$HOME/local" lcov \
--gcov-tool "$GCOV" \
--capture \
--directory build \
--output-file lcov.info \
--no-external
# Fail fast if lcov did not collect any project source file.
test "$(grep -c '^SF:' lcov.info || true)" -gt 0
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: Build Doxygen XML
shell: bash
run: |
set -e
cd doc/doxygen
conda run -p "$HOME/local" doxygen
cp images/* xml/
- name: Build Sphinx docs
shell: bash
run: |
set -e
cd doc/sphinx
conda run -p "$HOME/local" make html
if ! conda run -p "$HOME/local" make linkcheck; then
echo "Warning: Sphinx linkcheck failed (likely transient external outage); continuing."
fi
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: doc/sphinx/_build/html