-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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]>
- Loading branch information
Showing
8 changed files
with
3,318 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,66 +20,17 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
python-version: ["3.7", "3.9", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install mamba | ||
uses: mamba-org/provision-with-micromamba@main | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
environment-file: dev-environment.yml | ||
environment-name: pybind11_json | ||
micromamba-version: "0.22.0" | ||
extra-specs: python=${{ matrix.python-version }}*=*_cpython | ||
cache: false | ||
|
||
- name: Make build directory | ||
run: mkdir build | ||
- name: Run build | ||
run: pixi run 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 | ||
- name: Run tests | ||
run: pixi run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
build/* | ||
.pixi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[project] | ||
name = "pybind11_json" | ||
channels = ["conda-forge"] | ||
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] | ||
|
||
[dependencies] | ||
python = ">=3.7" | ||
|
||
# Build dependencies | ||
cmake = "*" | ||
cxx-compiler = "*" | ||
ninja = "*" | ||
# Host dependencies | ||
nlohmann_json = "*" | ||
pybind11 = "*" | ||
|
||
[tasks.test] | ||
cmd = "./build/test/test_pybind11_json" | ||
depends_on = ["build"] | ||
|
||
[tasks.configure] | ||
cmd = [ | ||
"cmake", | ||
"-GNinja", | ||
"-S.", | ||
"-Bbuild", | ||
"-DDOWNLOAD_GTEST=ON", | ||
"-DCMAKE_INSTALL_LIBDIR=lib", | ||
"-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX", | ||
] | ||
inputs = ["CMakeLists.txt"] | ||
outputs = ["build/CMakeFiles/"] | ||
|
||
[target.win-64.tasks.configure] | ||
cmd = [ | ||
"cmake", | ||
"-GNinja", | ||
"-S.", | ||
"-Bbuild", | ||
"-Dgtest_force_shared_crt=ON", | ||
"-DDOWNLOAD_GTEST=ON", | ||
"-DCMAKE_INSTALL_LIBDIR=Library", | ||
"-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX", | ||
] | ||
|
||
|
||
[tasks.build] | ||
cmd = ["cmake", "--build", "build"] | ||
depends_on = ["configure"] | ||
inputs = [ | ||
"CMakeLists.txt", | ||
"src/*" | ||
] | ||
outputs = [ | ||
"build/" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters