-
Notifications
You must be signed in to change notification settings - Fork 93
161 lines (138 loc) · 4.51 KB
/
build_with_conda.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build with conda
on:
push:
branches:
- master
# For Pull-Requests, this runs the CI on merge commit
# of HEAD with the target branch instead on HEAD, allowing
# testing against potential new states which might have
# been introduced in the target branch last commits.
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
pull_request:
jobs:
linux:
strategy:
matrix:
# we use two jobs for python and cpp tests st. they can run in parallel
include:
- os: ubuntu-latest
cpp_tests: "1"
python_tests: "0"
- os: ubuntu-latest
cpp_tests: "0"
python_tests: "1"
fail-fast: false
runs-on: ${{ matrix.os }}
services:
mongodb:
image: mongo:4.4
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Install Conda environment from environment_unix.yml
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment_unix.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
- name: Build ArcticDB with conda (ARCTICDB_USING_CONDA=1)
shell: bash -l {0}
run: |
# Protocol buffers compilation require not using build isolation.
python -m pip install --no-build-isolation --no-deps -v -e .
env:
ARCTICDB_USING_CONDA: 1
# Using one thread to avoid swapping which might freeze CI machines.
CMAKE_BUILD_PARALLEL_LEVEL: 1
ARCTICDB_BUILD_CPP_TESTS: ${{ matrix.cpp_tests }}
- name: Build C++ Tests
if: matrix.cpp_tests == '1'
shell: bash -l {0}
run: |
cd cpp/out/linux-conda-release-build/
make -j ${{ steps.cpu-cores.outputs.count }} arcticdb_rapidcheck_tests
make -j ${{ steps.cpu-cores.outputs.count }} test_unit_arcticdb
- name: Run C++ Tests
if: matrix.cpp_tests == '1'
shell: bash -l {0}
run: |
cd cpp/out/linux-conda-release-build/
make test
- name: Install npm # Linux github runner image does not come with npm
if: matrix.os == 'linux'
uses: actions/[email protected]
with:
node-version: '16'
- name: Test with pytest
shell: bash -l {0}
if: matrix.python_tests == '1'
run: |
npm install -g azurite
cd python
python -m pytest tests
env:
ARCTICDB_USING_CONDA: 1
macos:
strategy:
matrix:
include:
- os: macos-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Install Conda environment from environment_unix.yml
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment_unix.yml
environment-name: arcticdb
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
- name: Build ArcticDB with conda (ARCTICDB_USING_CONDA=1)
shell: bash -l {0}
run: |
# Protocol buffers compilation require not using build isolation.
python -m pip install --no-build-isolation --no-deps -v -e .
env:
ARCTICDB_USING_CONDA: 1
# Using one thread to avoid swapping which might freeze the CI machine.
CMAKE_BUILD_PARALLEL_LEVEL: 1
ARCTICDB_BUILD_CPP_TESTS: 1
- name: Build C++ Tests
shell: bash -l {0}
run: |
cd cpp/out/darwin-conda-release-build/
make -j ${{ steps.cpu-cores.outputs.count }} arcticdb_rapidcheck_tests
make -j ${{ steps.cpu-cores.outputs.count }} test_unit_arcticdb
- name: Run C++ Tests
shell: bash -l {0}
run: |
cd cpp/out/darwin-conda-release-build/
make test
- name: Install npm
uses: actions/[email protected]
with:
node-version: '16'
- name: Test with pytest
shell: bash -l {0}
run: |
npm install -g azurite
cd python
python -m pytest tests
env:
ARCTICDB_USING_CONDA: 1