-
Notifications
You must be signed in to change notification settings - Fork 286
103 lines (85 loc) · 2.79 KB
/
macos-linux-conda.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
name: MacOS-Linux-conda-CI
on: [push,pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
visp-conda:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} ${{ matrix.cxx_options }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
build_type: [Release]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install miniconda on ubuntu
uses: conda-incubator/setup-miniconda@v3
if: startsWith(matrix.os,'ubuntu') == true
with:
activate-environment: visp
auto-update-conda: true
environment-file: .github/workflows/conda/environment_linux.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Install miniconda on macOS
uses: conda-incubator/setup-miniconda@v3
if: startsWith(matrix.os,'macos') == true
with:
activate-environment: visp
auto-update-conda: true
environment-file: .github/workflows/conda/environment_macos.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Show conda config
shell: bash -el {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Determine number of processor on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
echo "NPROC=$(nproc)" >> $GITHUB_ENV
- name: Determine number of processor on MacOS
if: matrix.os == 'macos-latest'
run: |
echo "NPROC=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV
- name: Build visp python bindings
shell: bash -el {0}
run: |
echo "Number of processors: ${NPROC}"
mkdir build
cd build
cmake .. \
-G "Ninja" \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TUTORIALS=OFF \
-DBUILD_APPS=OFF \
-DBUILD_DEMOS=OFF \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
# Build
cmake --build . --parallel ${NPROC} --target visp_python_bindings
# Tests
cmake --build . --parallel ${NPROC} --target visp_python_bindings_test
check:
if: always()
name: check-macos-linux-conda
needs:
- visp-conda
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}