-
Notifications
You must be signed in to change notification settings - Fork 10
227 lines (223 loc) · 7.81 KB
/
main.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '00 02 */4 * *'
env:
RUST_BACKTRACE: 1
CLC_STABLE_HASH: "aecd4740aafb180c24f25de6c4188f39eb530c46"
jobs:
rust-tests:
name: Rust tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
rust: [stable, beta]
env:
RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10
steps:
- uses: actions/checkout@v4
- name: Checkout couchbase-lite-core
uses: actions/checkout@v4
with:
repository: 'dushistov/couchbase-lite-core'
ref: ${{ env.CLC_STABLE_HASH }}
submodules: 'recursive'
path: 'couchbase-lite-core'
- name: Export path to c++ library
run: |
echo "CORE_SRC=$GITHUB_WORKSPACE/couchbase-lite-core" >> $GITHUB_ENV
# We need to disable the existing toolchain to avoid updating rust-docs
# which takes a long time. The fastest way to do this is to rename the
# existing folder, as deleting it takes about as much time as not doing
# anything and just updating rust-docs.
- name: Rename existing rust toolchain (Windows)
if: matrix.os == 'windows-latest'
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- uses: actions/setup-python@v5
with:
python-version: '3.8.2'
- uses: jwlawson/[email protected]
with:
cmake-version: '3.21.x'
github-api-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install llvm tools on Windows
if: matrix.os == 'windows-latest'
run: |
set -e
curl https://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe -o llvm-installer.exe
7z x llvm-installer.exe -oc:\\llvm-binary
echo "LIBCLANG_PATH=C:\\llvm-binary\\bin" >> $GITHUB_ENV
echo "c:\\llvm-binary\\bin" >> $GITHUB_PATH
shell: bash
- name: Check versions
run: |
set -e
cargo --version
rustc --version
python --version
cmake --version
echo "end of versions checking"
shell: bash
- name: Run tests
run: |
set -e
cd $GITHUB_WORKSPACE
python ci/build_and_run_tests.py --rust-only
shell: bash
- name: Run tests with valgrind
if: matrix.os == 'ubuntu-20.04' && matrix.rust == 'stable'
run: |
set -e
cat /etc/issue
curl -L https://github.com/Dushistov/valgrind/releases/download/dwarf5-fix1/valgrind-git-bin-18072022.tar.bz2 -o valgrind-git-bin.tar.bz2
sudo tar -xjvpf valgrind-git-bin.tar.bz2 -C /
sudo apt-get update -y
sudo apt-get install -y libc6-dbg
valgrind --version
cargo install cargo-valgrind
python ci/build_and_run_tests.py --rust-only-with-valigrind
shell: bash
ios-tests:
name: Check work with iOS
runs-on: macos-13
strategy:
fail-fast: true
matrix:
rust: [stable, beta]
env:
RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10
steps:
- uses: actions/checkout@v4
- name: Checkout couchbase-lite-core
uses: actions/checkout@v4
with:
repository: 'dushistov/couchbase-lite-core'
ref: ${{ env.CLC_STABLE_HASH }}
submodules: 'recursive'
path: 'couchbase-lite-core'
- name: Export path to c++ library
run: |
echo "CORE_SRC=$GITHUB_WORKSPACE/couchbase-lite-core" >> $GITHUB_ENV
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: "aarch64-apple-ios"
- uses: actions/setup-python@v5
with:
python-version: '3.8.2'
- uses: jwlawson/[email protected]
with:
cmake-version: '3.21.x'
github-api-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check versions
run: |
set -e
cargo --version
rustc --version
python --version
cmake --version
echo "end of versions checking"
shell: bash
- name: Run tests
run: |
set -e
cd $GITHUB_WORKSPACE
python ci/build_and_run_tests.py --rust-ios-only
shell: bash
# Rebuild C++ part here, because of in build.rs we don't build unit tests
cpp-tests:
name: C++ tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
steps:
- uses: actions/checkout@v4
- name: Checkout couchbase-lite-core
uses: actions/checkout@v4
with:
repository: 'dushistov/couchbase-lite-core'
ref: ${{ env.CLC_STABLE_HASH }}
submodules: 'recursive'
path: 'couchbase-lite-core'
- name: Export path to c++ library
run: |
echo "CORE_SRC=$GITHUB_WORKSPACE/couchbase-lite-core" >> $GITHUB_ENV
- uses: actions/setup-python@v5
with:
python-version: '3.8.2'
- uses: jwlawson/[email protected]
with:
cmake-version: '3.21.x'
github-api-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add fr_FR locale
if: matrix.os == 'ubuntu-20.04'
run: |
set -e
sudo locale-gen fr_FR
sudo update-locale
shell: bash
- name: Run tests
run: |
set -e
cd $GITHUB_WORKSPACE
python ci/build_and_run_tests.py --cpp-only
shell: bash
# Detect cases where documentation links don't resolve and such.
nightly-only-tools:
name: Checks with rustc/nightly
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Checkout couchbase-lite-core
uses: actions/checkout@v4
with:
repository: 'dushistov/couchbase-lite-core'
ref: ${{ env.CLC_STABLE_HASH }}
submodules: 'recursive'
path: 'couchbase-lite-core'
- name: Export path to c++ library
run: |
echo "COUCHBASE_LITE_CORE_SRC_DIR=$GITHUB_WORKSPACE/couchbase-lite-core" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1
with:
profile: minimal
# Docs.rs uses nightly, which allows for easier syntax for linking to functions.
toolchain: nightly
override: true
components: rust-src,rustfmt,clippy
- name: rustdoc for couchbase-lite
run: cargo rustdoc -p couchbase-lite --no-default-features --features="build-cpp,use-couchbase-lite-sqlite,use-tokio-websocket,use-native-tls" -- -D warnings
- name: rustdoc for couchbase-lite-core-sys
run: cargo rustdoc -p couchbase-lite-core-sys --no-default-features --features="build,use-couchbase-lite-sqlite" -- -D warnings
- name: Tests with asan
env:
RUSTFLAGS: -Zsanitizer=address -Cdebuginfo=0
RUSTDOCFLAGS: -Zsanitizer=address
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=0"
# Work around https://github.com/rust-lang/rust/issues/59125 by
# disabling backtraces. In an ideal world we'd probably suppress the
# leak sanitization, but we don't care about backtraces here, so long
# as the other tests have them.
RUST_BACKTRACE: "0"
run: cargo -Z build-std test --no-default-features --features="build-cpp,use-couchbase-lite-sqlite,use-tokio-websocket,use-native-tls,with-asan" --target x86_64-unknown-linux-gnu