Skip to content

Commit e83e80e

Browse files
committed
[ci-ubuntu] add macos and use conda-env for ci
1 parent 00937c0 commit e83e80e

File tree

2 files changed

+68
-58
lines changed

2 files changed

+68
-58
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: PyCppAD CI for MacOS/Linux
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- devel
9+
10+
11+
env:
12+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
13+
BUILD_TYPE: Release
14+
15+
jobs:
16+
build:
17+
# The CMake configure and build commands are platform agnostic and should work equally
18+
# well on Windows or Mac. You can convert this to a matrix build if you need
19+
# cross-platform coverage.
20+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
21+
runs-on: ${{ matrix.os }}
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: ["ubuntu-latest", "macos-latest"]
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: Checkout submodules
32+
run: |
33+
git submodule update --init
34+
35+
- uses: conda-incubator/setup-miniconda@v2
36+
with:
37+
activate-environment: pycppad
38+
auto-update-conda: true
39+
environment-file: .github/workflows/conda/conda-env.yml
40+
python-version: 3.8
41+
42+
- name: Install cmake and update conda
43+
shell: bash -l {0}
44+
run: |
45+
conda activate pycppad
46+
conda install cmake -c main
47+
48+
- name: Build PyCppAD
49+
shell: bash -l {0}
50+
run: |
51+
conda activate pycppad
52+
echo $CONDA_PREFIX
53+
54+
mkdir build
55+
cd build
56+
57+
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON
58+
make
59+
make build_tests
60+
export CTEST_OUTPUT_ON_FAILURE=1
61+
make test
62+
make install
63+
64+
- name: Uninstall PyCppAD
65+
shell: bash -l {0}
66+
run: |
67+
cd build
68+
make uninstall

.github/workflows/ci-ubuntu.yml

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

0 commit comments

Comments
 (0)