-
Notifications
You must be signed in to change notification settings - Fork 35
85 lines (73 loc) · 2.22 KB
/
main.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
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
defaults:
run:
shell: bash -l {0}
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: dev-environment.yml
environment-name: pybind11_json
micromamba-version: "0.22.0"
extra-specs: python=${{ matrix.python-version }}*=*_cpython
- name: Make build directory
run: mkdir build
- name: Micromamba shell hook
if: matrix.os == 'windows-latest'
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
- name: Unix, install
if: matrix.os != 'windows-latest'
run: |
micromamba activate pybind11_json
cmake .. \
-D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-D DOWNLOAD_GTEST=ON \
-D PYTHON_EXECUTABLE=`which python` \
-D CMAKE_INSTALL_LIBDIR=lib
make install -j2
working-directory: build
- name: Windows, install
if: matrix.os == 'windows-latest'
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate pybind11_json
cmake .. ^
-G Ninja ^
-D CMAKE_INSTALL_PREFIX="%CONDA_PREFIX%\Library" ^
-D DOWNLOAD_GTEST=ON ^
-D gtest_force_shared_crt=ON ^
-D CMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
ninja install
working-directory: build
- name: Unix, Run tests
if: matrix.os != 'windows-latest'
run: |
micromamba activate pybind11_json
./test_pybind11_json
working-directory: build/test
- name: Windows, Run tests
if: matrix.os == 'windows-latest'
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate pybind11_json
set PYTHONHOME=%CONDA_PREFIX%
test_pybind11_json
working-directory: build/test