Skip to content

Commit 22528f7

Browse files
authored
ci: use pixi in CI (#66)
* ci: use pixi in CI Signed-off-by: Henry Schreiner <[email protected]> * ci: try different command on Windows Signed-off-by: Henry Schreiner <[email protected]> * ci: remove features/environments Signed-off-by: Henry Schreiner <[email protected]> * Update .github/workflows/main.yml --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 1399451 commit 22528f7

File tree

8 files changed

+3318
-72
lines changed

8 files changed

+3318
-72
lines changed

.github/workflows/main.yml

+8-57
Original file line numberDiff line numberDiff line change
@@ -20,66 +20,17 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, macos-latest, windows-latest]
23-
python-version: ["3.7", "3.8", "3.9", "3.10"]
23+
python-version: ["3.7", "3.9", "3.11", "3.12"]
2424

2525
steps:
26-
- uses: actions/checkout@v1
26+
- uses: actions/checkout@v4
2727

28-
- name: Install mamba
29-
uses: mamba-org/provision-with-micromamba@main
28+
- uses: prefix-dev/[email protected]
3029
with:
31-
environment-file: dev-environment.yml
32-
environment-name: pybind11_json
33-
micromamba-version: "0.22.0"
34-
extra-specs: python=${{ matrix.python-version }}*=*_cpython
30+
cache: false
3531

36-
- name: Make build directory
37-
run: mkdir build
32+
- name: Run build
33+
run: pixi run build
3834

39-
- name: Micromamba shell hook
40-
if: matrix.os == 'windows-latest'
41-
shell: powershell
42-
run: |
43-
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
44-
45-
- name: Unix, install
46-
if: matrix.os != 'windows-latest'
47-
run: |
48-
micromamba activate pybind11_json
49-
cmake .. \
50-
-D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
51-
-D DOWNLOAD_GTEST=ON \
52-
-D PYTHON_EXECUTABLE=`which python` \
53-
-D CMAKE_INSTALL_LIBDIR=lib
54-
make install -j2
55-
working-directory: build
56-
57-
- name: Windows, install
58-
if: matrix.os == 'windows-latest'
59-
shell: cmd
60-
run: |
61-
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate pybind11_json
62-
cmake .. ^
63-
-G Ninja ^
64-
-D CMAKE_INSTALL_PREFIX="%CONDA_PREFIX%\Library" ^
65-
-D DOWNLOAD_GTEST=ON ^
66-
-D gtest_force_shared_crt=ON ^
67-
-D CMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
68-
ninja install
69-
working-directory: build
70-
71-
- name: Unix, Run tests
72-
if: matrix.os != 'windows-latest'
73-
run: |
74-
micromamba activate pybind11_json
75-
./test_pybind11_json
76-
working-directory: build/test
77-
78-
- name: Windows, Run tests
79-
if: matrix.os == 'windows-latest'
80-
shell: cmd
81-
run: |
82-
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate pybind11_json
83-
set PYTHONHOME=%CONDA_PREFIX%
84-
test_pybind11_json
85-
working-directory: build/test
35+
- name: Run tests
36+
run: pixi run test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
build/*
2+
.pixi

dev-environment.yml

-11
This file was deleted.

pixi.lock

+3,249
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[project]
2+
name = "pybind11_json"
3+
channels = ["conda-forge"]
4+
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
5+
6+
[dependencies]
7+
python = ">=3.7"
8+
9+
# Build dependencies
10+
cmake = "*"
11+
cxx-compiler = "*"
12+
ninja = "*"
13+
# Host dependencies
14+
nlohmann_json = "*"
15+
pybind11 = "*"
16+
17+
[tasks.test]
18+
cmd = "./build/test/test_pybind11_json"
19+
depends_on = ["build"]
20+
21+
[tasks.configure]
22+
cmd = [
23+
"cmake",
24+
"-GNinja",
25+
"-S.",
26+
"-Bbuild",
27+
"-DDOWNLOAD_GTEST=ON",
28+
"-DCMAKE_INSTALL_LIBDIR=lib",
29+
"-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX",
30+
]
31+
inputs = ["CMakeLists.txt"]
32+
outputs = ["build/CMakeFiles/"]
33+
34+
[target.win-64.tasks.configure]
35+
cmd = [
36+
"cmake",
37+
"-GNinja",
38+
"-S.",
39+
"-Bbuild",
40+
"-Dgtest_force_shared_crt=ON",
41+
"-DDOWNLOAD_GTEST=ON",
42+
"-DCMAKE_INSTALL_LIBDIR=Library",
43+
"-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX",
44+
]
45+
46+
47+
[tasks.build]
48+
cmd = ["cmake", "--build", "build"]
49+
depends_on = ["configure"]
50+
inputs = [
51+
"CMakeLists.txt",
52+
"src/*"
53+
]
54+
outputs = [
55+
"build/"
56+
]

test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The full license is in the file LICENSE, distributed with this software. #
77
############################################################################
88

9-
cmake_minimum_required(VERSION 3.4.3)
9+
cmake_minimum_required(VERSION 3.5)
1010

1111
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
1212
project(pybind11_json-test)

test/copyGTest.cmake.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The full license is in the file LICENSE, distributed with this software. #
77
############################################################################
88

9-
cmake_minimum_required(VERSION 2.8.2)
9+
cmake_minimum_required(VERSION 3.5)
1010

1111
project(googletest-download NONE)
1212

test/downloadGTest.cmake.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
# The full license is in the file LICENSE, distributed with this software. #
77
############################################################################
88

9-
cmake_minimum_required(VERSION 2.8.2)
9+
cmake_minimum_required(VERSION 3.5)
1010

1111
project(googletest-download NONE)
1212

1313
include(ExternalProject)
1414
ExternalProject_Add(googletest
1515
GIT_REPOSITORY https://github.com/google/googletest.git
16-
GIT_TAG release-1.8.0
16+
GIT_TAG release-1.12.1
1717
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
1818
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
1919
CONFIGURE_COMMAND ""

0 commit comments

Comments
 (0)