Skip to content

Commit e8fa517

Browse files
committed
CI: adding GitHub Actions runners
1 parent 6544a55 commit e8fa517

File tree

4 files changed

+91
-4
lines changed

4 files changed

+91
-4
lines changed

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
12+
standard:
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
18+
19+
defaults:
20+
run:
21+
shell: bash -l {0}
22+
23+
name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }}
24+
runs-on: ${{ matrix.runs-on }}
25+
26+
steps:
27+
28+
- name: Basic GitHub action setup
29+
uses: actions/checkout@v2
30+
31+
- name: Set conda environment
32+
uses: mamba-org/provision-with-micromamba@main
33+
with:
34+
environment-name: myenv
35+
environment-file: environment-dev.yml
36+
cache-env: true
37+
extra-specs: |
38+
ninja
39+
40+
- name: Configure using CMake
41+
run: cmake -Bbuild -G "Ninja" -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DPYTHON_EXECUTABLE=`which python` -DDOWNLOAD_GTEST=ON
42+
43+
- name: Install
44+
working-directory: build
45+
run: cmake --install .
46+
47+
- name: Build xtensor-python
48+
working-directory: build
49+
run: cmake --build .
50+
51+
- name: Test xtensor-python
52+
working-directory: build/test
53+
run: ./test_xtensor_python
54+
55+
- name: Test xtensor-python (Python)
56+
run: py.test -s
57+
58+
- name: Example - readme 1
59+
working-directory: docs/source/examples/readme_example_1
60+
run: |
61+
cmake -Bbuild -DPython_EXECUTABLE=`which python`
62+
cd build
63+
cmake --build .
64+
cp ../example.py .
65+
python example.py
66+
cd ..
67+
68+
- name: Example - Copy 'cast'
69+
working-directory: docs/source/examples/copy_cast
70+
run: |
71+
cmake -Bbuild -DPython_EXECUTABLE=`which python`
72+
cd build
73+
cmake --build .
74+
cp ../example.py .
75+
python example.py
76+
cd ..
77+
78+
- name: Example - SFINAE
79+
working-directory: docs/source/examples/sfinae
80+
run: |
81+
cmake -Bbuild -DPython_EXECUTABLE=`which python`
82+
cd build
83+
cmake --build .
84+
cp ../example.py .
85+
python example.py
86+
cd ..
87+

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ foreach(ver ${xtensor_python_version_defines})
2525
set(XTENSOR_PYTHON_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "")
2626
endif()
2727
endforeach()
28-
set(${PROJECT_NAME}_VERSION
28+
set(${PROJECT_NAME}_VERSION
2929
${XTENSOR_PYTHON_VERSION_MAJOR}.${XTENSOR_PYTHON_VERSION_MINOR}.${XTENSOR_PYTHON_VERSION_PATCH})
3030
message(STATUS "xtensor-python v${${PROJECT_NAME}_VERSION}")
3131

@@ -45,7 +45,7 @@ else()
4545
find_package(xtensor ${xtensor_REQUIRED_VERSION} REQUIRED)
4646
message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor")
4747
endif()
48-
48+
4949
# Currently no required version for pybind11
5050
if(TARGET pybind11 OR TARGET pybind11::headers)
5151
# pybind11 has a variable that indicates its version already, so use that

benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
5454
endif()
5555

5656
if(MSVC)
57-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /bigobj")
57+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /bigobj /DHAVE_SNPRINTF")
5858
set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO)
5959
foreach(flag_var
6060
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
4141
endif()
4242

4343
if(MSVC)
44-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /bigobj")
44+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /bigobj /DHAVE_SNPRINTF")
4545
set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO)
4646
endif()
4747

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy