-
Notifications
You must be signed in to change notification settings - Fork 98
179 lines (155 loc) · 5.68 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
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:
workflow_dispatch:
inputs:
run_on_arm_mac:
description: 'Run on arm macos'
type: boolean
required: false
default: false
jobs:
linux:
if: |
always() &&
!cancelled()
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
services:
mongodb:
image: mongo:4.4
steps:
- uses: actions/checkout@v3.3.0
# DONT use recursive submodules checkout to simulate conda feedstock build
# with:
# submodules: recursive
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1.1.0
id: cpu-cores
- name: Install Conda environment from environment_unix.yml
uses: mamba-org/setup-micromamba@v2.0.0
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
ARCTICDB_BUILD_CPP_TESTS: 1
ARCTICDB_PROTOC_VERS: "4"
- name: Build C++ Tests
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
shell: bash -l {0}
run: |
cd cpp/out/linux-conda-release-build/
CTEST_OUTPUT_ON_FAILURE=1 make test
# Note: mongo tests are skipped in the macos workflow
# These steps are official: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition
- name: Install mongo for mongod executable needed as a fallback server fixture
shell: bash -l {0}
run: |
sudo apt-get install gnupg curl
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
- name: Install npm # Linux github runner image does not come with npm
uses: actions/setup-node@v3.3.0
with:
node-version: '16'
- name: Install azurite
shell: bash -l {0}
run: |
npm install -g azurite
- name: Test with pytest
shell: bash -l {0}
run: |
cd python
export ARCTICDB_RAND_SEED=$RANDOM
python -m pytest --timeout=3600 -n ${{ steps.cpu-cores.outputs.count }} -v tests
env:
ARCTICDB_USING_CONDA: 1
# Use the Mongo created in the service container above to test against
CI_MONGO_HOST: mongodb
macos:
strategy:
matrix:
include:
- os: macos-13
fail-fast: false
runs-on: ${{ inputs.run_on_arm_mac == true && 'macos-13-xlarge' || matrix.os }}
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v3.3.0
# DONT use recursive submodules checkout to simulate conda feedstock build
# with:
# submodules: recursive
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1.1.0
id: cpu-cores
- name: Install Conda environment from environment_unix.yml
uses: mamba-org/setup-micromamba@v2.0.0
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
ARCTICDB_BUILD_CPP_TESTS: 1
ARCTICDB_PROTOC_VERS: "4"
- 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/
CTEST_OUTPUT_ON_FAILURE=1 make test
- name: Install npm
uses: actions/setup-node@v3.3.0
with:
node-version: '16'
- name: Install azurite
shell: bash -l {0}
run: |
npm install -g azurite
- name: Test with pytest
shell: bash -l {0}
run: |
cd python
export ARCTICDB_RAND_SEED=$RANDOM
python -m pytest --timeout=3600 -n ${{ steps.cpu-cores.outputs.count }} tests
env:
ARCTICDB_USING_CONDA: 1