Skip to content

Commit e666894

Browse files
committed
ci: Modernize CI
1 parent 3b7e0a4 commit e666894

File tree

6 files changed

+94
-208
lines changed

6 files changed

+94
-208
lines changed

.github/workflows/ci-ubuntu-macos.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,39 @@ jobs:
2222
os: ["ubuntu-latest", "macos-latest"]
2323

2424
steps:
25-
- uses: actions/checkout@v2
26-
27-
- name: Checkout submodules
28-
run: |
29-
git submodule update --init
25+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
3028

31-
- uses: conda-incubator/setup-miniconda@v2
29+
- uses: conda-incubator/setup-miniconda@v3
3230
with:
3331
activate-environment: pycppad
3432
auto-update-conda: true
3533
environment-file: .github/workflows/conda/conda-env.yml
3634
python-version: 3.8
37-
38-
- name: Install cmake and update conda
39-
shell: bash -l {0}
40-
run: |
41-
conda activate pycppad
42-
conda install cmake -c main
35+
auto-activate-base: false
4336

4437
- name: Build PyCppAD
45-
shell: bash -l {0}
38+
shell: bash -el {0}
4639
run: |
47-
conda activate pycppad
40+
conda list
4841
echo $CONDA_PREFIX
4942
5043
mkdir build
5144
cd build
5245
53-
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON
54-
make
55-
export CTEST_OUTPUT_ON_FAILURE=1
56-
make test
57-
make install
46+
cmake .. \
47+
-G "Ninja" \
48+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
49+
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
50+
-DPYTHON_EXECUTABLE=$(which python3) \
51+
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON
52+
ninja -j1
53+
ctest --output-on-failure -C Release -V
54+
ninja install
5855
5956
- name: Uninstall PyCppAD
60-
shell: bash -l {0}
57+
shell: bash -el {0}
6158
run: |
6259
cd build
63-
make uninstall
60+
ninja uninstall

.github/workflows/ci-windows-clang.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

.github/workflows/ci-windows-v142.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/ci-windows.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: PyCppAD CI for Windows
2+
on:
3+
pull_request:
4+
push:
5+
6+
env:
7+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
8+
BUILD_TYPE: Release
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
os: [windows-2019]
18+
compiler:
19+
- cmd: cl
20+
cppad_codegen: OFF
21+
- cmd: clang-cl
22+
cppad_codegen: ON
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
29+
- uses: conda-incubator/setup-miniconda@v3
30+
with:
31+
activate-environment: pycppad
32+
auto-update-conda: true
33+
environment-file: .github/workflows/conda/conda-env.yml
34+
python-version: 3.8
35+
auto-activate-base: false
36+
37+
- name: Build PyCppAD
38+
shell: cmd /C CALL {0}
39+
run: |
40+
:: Set compiler to use.
41+
:: This must be done here and not in env since
42+
:: cxx-compiler activation script set this variable
43+
:: and is called before.
44+
set CC=${{ matrix.compiler.cmd }}
45+
set CXX=${{ matrix.compiler.cmd }}
46+
47+
:: Create build directory
48+
mkdir build
49+
pushd build
50+
51+
:: Configure
52+
cmake ^
53+
-G "Ninja" ^
54+
-DCMAKE_BUILD_TYPE=Release ^
55+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
56+
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
57+
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
58+
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=${{ matrix.compiler.cppad_codegen }} ^
59+
..
60+
61+
:: Build
62+
ninja -j1
63+
64+
:: Testing
65+
ctest --output-on-failure -C Release -V
66+
67+
:: Test Python import
68+
ninja install
69+
cd ..
70+
python -c "import pycppad"

.github/workflows/conda/conda-env-win.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: pycppad
22
channels:
33
- conda-forge
4-
- nodefaults
54
dependencies:
65
- boost
76
- eigenpy
87
- python
98
- cppad
10-
- cppadcodegen
9+
- cppadcodegen
10+
- ninja
11+
- cmake
12+
- pkg-config
13+
- ninja
14+
- cxx-compiler

0 commit comments

Comments
 (0)