|
| 1 | +name: Build with conda |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + unix: |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + include: |
| 11 | + - os: ubuntu-latest |
| 12 | + - os: macos-latest |
| 13 | + |
| 14 | + fail-fast: false |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - name: Get number of CPU cores |
| 20 | + uses: SimenB/github-actions-cpu-cores@v1 |
| 21 | + id: cpu-cores |
| 22 | + |
| 23 | + - name: Install Conda environment from environment.yml |
| 24 | + uses: mamba-org/setup-micromamba@v1 |
| 25 | + with: |
| 26 | + environment-file: environment.yml |
| 27 | + init-shell: >- |
| 28 | + bash |
| 29 | + cache-environment: true |
| 30 | + post-cleanup: 'all' |
| 31 | + |
| 32 | + |
| 33 | + - name: cmake configure |
| 34 | + shell: bash -l {0} |
| 35 | + run: | |
| 36 | + mkdir -p bld |
| 37 | + cd bld |
| 38 | + cmake \ |
| 39 | + -DCMAKE_BUILD_TYPE=Release \ |
| 40 | + -DXPLUGIN_BUILD_TESTS=ON \ |
| 41 | + -DXPLUGIN_BUILD_EXAMPLES=ON \ |
| 42 | + -DXPLUGIN_BUILD_DOCS=ON \ |
| 43 | + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ |
| 44 | + .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX |
| 45 | +
|
| 46 | + - name: Build |
| 47 | + shell: bash -l {0} |
| 48 | + run: | |
| 49 | + cd bld |
| 50 | + make -j ${{ steps.cpu-cores.outputs.count }} |
| 51 | +
|
| 52 | + - name: Run C++ tests |
| 53 | + shell: bash -l {0} |
| 54 | + run: | |
| 55 | + cd bld |
| 56 | + ctest -V |
| 57 | +
|
| 58 | + - name: Run examples |
| 59 | + shell: bash -l {0} |
| 60 | + run: | |
| 61 | + cd bld/examples/ |
| 62 | +
|
| 63 | + pushd accumulator |
| 64 | + ./main_accumulator . |
| 65 | + popd |
| 66 | +
|
| 67 | + pushd serialize |
| 68 | + ./main_serialize . |
| 69 | + popd |
| 70 | +
|
| 71 | + pushd custom_factory_with_metadata |
| 72 | + ./main_custom_factory_with_metadata . |
| 73 | + popd |
| 74 | +
|
| 75 | +
|
| 76 | +
|
| 77 | + - name: Install |
| 78 | + shell: bash -l {0} |
| 79 | + run: | |
| 80 | + cd bld |
| 81 | + make install |
| 82 | +
|
| 83 | + - name: Test installation |
| 84 | + shell: bash -l {0} |
| 85 | + run: | |
| 86 | + cd examples/serialize |
| 87 | + mkdir -p bld |
| 88 | + cd bld |
| 89 | + cmake \ |
| 90 | + -DCMAKE_BUILD_TYPE=Release \ |
| 91 | + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ |
| 92 | + .. |
| 93 | + make -j ${{ steps.cpu-cores.outputs.count }} |
| 94 | + ./main_serialize . |
| 95 | +
|
| 96 | + windows: |
| 97 | + strategy: |
| 98 | + matrix: |
| 99 | + include: |
| 100 | + - os: windows-latest |
| 101 | + fail-fast: false |
| 102 | + runs-on: ${{ matrix.os }} |
| 103 | + |
| 104 | + steps: |
| 105 | + |
| 106 | + - uses: actions/checkout@v3 |
| 107 | + |
| 108 | + - name: Install Conda environment from environment.yml |
| 109 | + uses: mamba-org/setup-micromamba@v1 |
| 110 | + with: |
| 111 | + environment-file: environment.yml |
| 112 | + init-shell: >- |
| 113 | + cmd.exe |
| 114 | + cache-environment: true |
| 115 | + post-cleanup: 'all' |
| 116 | + |
| 117 | + - name: build and test |
| 118 | + shell: cmd /C CALL {0} |
| 119 | + run: | |
| 120 | + mkdir bld |
| 121 | + cd bld |
| 122 | + cmake .. ^ |
| 123 | + -G Ninja ^ |
| 124 | + -DCMAKE_BUILD_TYPE=Release ^ |
| 125 | + -DXPLUGIN_BUILD_TESTS=ON ^ |
| 126 | + -DXPLUGIN_BUILD_EXAMPLES=OFF ^ |
| 127 | + -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^ |
| 128 | + -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX% |
| 129 | +
|
| 130 | + cmake --build . --config Release |
| 131 | + ctest -C Release -V |
| 132 | +
|
| 133 | + - name: Install |
| 134 | + shell: cmd /C CALL {0} |
| 135 | + run: | |
| 136 | + cd bld |
| 137 | + cmake --install . --config Release |
| 138 | +
|
| 139 | + - name: Test installation |
| 140 | + shell: cmd /C CALL {0} |
| 141 | + run: | |
| 142 | + cd examples |
| 143 | + cd serialize |
| 144 | + mkdir bld |
| 145 | + cd bld |
| 146 | + cmake .. ^ |
| 147 | + -G Ninja ^ |
| 148 | + -DCMAKE_BUILD_TYPE=Release ^ |
| 149 | + -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" |
| 150 | +
|
| 151 | + SET thisdir=%cd% |
| 152 | + cmake --build . --config Release |
| 153 | + main_serialize.exe %thisdir% |
| 154 | +
|
| 155 | + emscripten: |
| 156 | + strategy: |
| 157 | + matrix: |
| 158 | + include: |
| 159 | + - emscripten_version: 3.1.27 |
| 160 | + fail-fast: false |
| 161 | + runs-on: ubuntu-latest |
| 162 | + steps: |
| 163 | + - uses: actions/checkout@v3 |
| 164 | + - name: Get number of CPU cores |
| 165 | + uses: SimenB/github-actions-cpu-cores@v1 |
| 166 | + id: cpu-cores |
| 167 | + |
| 168 | + - name: Install Conda environment from environment_emscripten.yml |
| 169 | + uses: mamba-org/setup-micromamba@v1 |
| 170 | + with: |
| 171 | + environment-file: environment_emscripten.yml |
| 172 | + init-shell: >- |
| 173 | + bash |
| 174 | + cache-environment: true |
| 175 | + post-cleanup: 'all' |
| 176 | + |
| 177 | + - name: install emscripten |
| 178 | + shell: bash -l {0} |
| 179 | + run: | |
| 180 | + git clone https://github.com/emscripten-core/emsdk.git |
| 181 | + cd emsdk |
| 182 | + ./emsdk install ${{ matrix.emscripten_version }} |
| 183 | + source ./emsdk_env.sh |
| 184 | +
|
| 185 | + - name: install playwright |
| 186 | + shell: bash -l {0} |
| 187 | + run: | |
| 188 | + playwright install |
| 189 | +
|
| 190 | + - name: run emscripten tests |
| 191 | + shell: bash -l {0} |
| 192 | + run: | |
| 193 | + cd emsdk |
| 194 | + ./emsdk activate ${{ matrix.emscripten_version }} |
| 195 | + source ./emsdk_env.sh |
| 196 | + cd .. |
| 197 | + chmod +x ./test/emscripten/test_emscripten.sh |
| 198 | + ./test/emscripten/test_emscripten.sh |
| 199 | +
|
| 200 | + docs: |
| 201 | + strategy: |
| 202 | + matrix: |
| 203 | + include: |
| 204 | + - os: ubuntu-latest |
| 205 | + |
| 206 | + fail-fast: false |
| 207 | + runs-on: ${{ matrix.os }} |
| 208 | + steps: |
| 209 | + - uses: actions/checkout@v3 |
| 210 | + |
| 211 | + - name: Install Conda environment from environment.yml |
| 212 | + uses: mamba-org/setup-micromamba@v1 |
| 213 | + with: |
| 214 | + environment-file: environment.yml |
| 215 | + init-shell: >- |
| 216 | + bash |
| 217 | + cache-environment: true |
| 218 | + post-cleanup: 'all' |
| 219 | + |
| 220 | + - name: cmake configure |
| 221 | + shell: bash -l {0} |
| 222 | + run: | |
| 223 | + mkdir -p bld |
| 224 | + cd bld |
| 225 | + cmake \ |
| 226 | + -DCMAKE_BUILD_TYPE=Release \ |
| 227 | + -DXPLUGIN_BUILD_TESTS=OFF \ |
| 228 | + -DXPLUGIN_BUILD_EXAMPLES= \ |
| 229 | + -DXPLUGIN_BUILD_DOCS=ON \ |
| 230 | + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ |
| 231 | + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ |
| 232 | + .. |
| 233 | +
|
| 234 | + - name: Build docs |
| 235 | + shell: bash -l {0} |
| 236 | + run: | |
| 237 | + cd bld |
| 238 | + make docs_sphinx |
| 239 | +
|
| 240 | + # add .nojekyll file to docs folder |
| 241 | + touch docs/html/.nojekyll |
0 commit comments