-
Notifications
You must be signed in to change notification settings - Fork 594
87 lines (79 loc) · 2.53 KB
/
conda-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CondaDev
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop
jobs:
build:
name: abc ${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04', 'ubuntu-20.04', 'macOS-11', 'windows-2019']
python-version: ['3.11']
use_namespace: [false, true]
include:
- os: 'ubuntu-22.04'
generator: 'Ninja'
build_type: 'Release'
- os: 'ubuntu-20.04'
generator: 'Ninja'
build_type: 'RelWithDebInfo'
- os: 'macOS-11'
generator: 'Ninja'
build_type: 'Release'
- os: 'windows-2019'
generator: 'Ninja'
build_type: 'Release'
extra_args: '-DABC_USE_NO_PTHREADS=ON -DABC_USE_NO_READLINE=ON'
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
PYTHONIOENCODING: utf-8
CMAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=xxx' || '' }}
steps:
- uses: actions/checkout@v3
- name: Setup base python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Cache conda
id: cache
uses: actions/cache@v3
env:
# Increase this value to reset cache if environment.devenv.yml has not changed
CACHE_NUMBER: 1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.devenv.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: strict
use-only-tar-bz2: true
- name: Configure condadev environment
shell: bash -l {0}
env:
PY_VER: ${{ matrix.python-version }}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install conda-devenv=2.1.1
conda devenv
- name: Build and test
shell: bash -l {0}
env:
PY_VER: ${{ matrix.python-version }}
run: |
source activate abc-test
ctest --build-generator "${{ matrix.generator }}" \
--build-and-test . build \
--build-options ${CMAKE_ARGS} ${{ matrix.extra_args }} \
-DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
--test-command ctest --rerun-failed --output-on-failure -V