Skip to content

Commit 70e5e80

Browse files
authored
all platforms, all the time (#166)
* all platforms, all the time * ci lint * getredis on all platforms * adding system-setup to dockers * returned build steps for both * optional full path to redis-server in /usr/local It appears as though /usr/local/bin does not descend into the PATH variable on some linuxes when run through rust Command::new. * test fixes, {debug|release} * release in test mode - because dockers * test: passing gmake vs make for osx * same, on tests
1 parent 343bc14 commit 70e5e80

File tree

4 files changed

+31
-16
lines changed

4 files changed

+31
-16
lines changed

.circleci/config.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ commands:
4343
(mkdir -p deps; cd deps; git clone https://github.com/RedisLabsModules/readies.git)
4444
./deps/readies/bin/getpy3
4545
46+
setup-build-environment:
47+
steps:
48+
- run:
49+
name: Setup build environment
50+
command: |
51+
./sbin/system-setup.py
52+
source $HOME/.cargo/env
53+
rustc --version
54+
cargo --version
55+
rustup --version
56+
4657
checkout-all:
4758
steps:
4859
- checkout
@@ -52,6 +63,9 @@ commands:
5263

5364
build-steps:
5465
parameters:
66+
make_bin:
67+
type: string
68+
default: "make"
5569
build_params:
5670
type: string
5771
default: ""
@@ -76,11 +90,6 @@ commands:
7690
rustc --version
7791
cargo --version
7892
rustup --version
79-
- run:
80-
name: Install Redis
81-
command: |
82-
bash -l -c "./deps/readies/bin/getredis -v <<parameters.redis_version>> --force <<parameters.getredis_params>>"
83-
redis-server --version
8493
- restore_cache:
8594
keys:
8695
- v3-dependencies-{{ arch }}-{{ checksum "Cargo.toml" }}
@@ -90,18 +99,18 @@ commands:
9099
# command: bash -l -c "make lint"
91100
- run:
92101
name: Build debug
93-
command: bash -l -c "make build DEBUG=1 <<parameters.build_params>>"
102+
command: bash -l -c "<<parameters.make_bin>> build DEBUG=1 <<parameters.build_params>>"
94103
- run:
95104
name: Build release
96-
command: bash -l -c "make build <<parameters.build_params>>"
105+
command: bash -l -c "<<parameters.make_bin>> build <<parameters.build_params>>"
97106
- save_cache:
98107
key: v3-dependencies-{{ arch }}-{{ checksum "Cargo.toml" }}
99108
paths:
100109
- "~/.cargo"
101110
- "./target"
102111
- run:
103112
name: Run all tests
104-
command: bash -l -c "make test"
113+
command: bash -l -c "<<parameters.make_bin>> test"
105114

106115
platforms-build-steps:
107116
parameters:
@@ -112,6 +121,7 @@ commands:
112121
- setup-executor
113122
- checkout-all
114123
- setup-automation
124+
- setup-build-environment
115125
- run:
116126
name: Build for platform
117127
command: |
@@ -130,7 +140,7 @@ jobs:
130140
platform:
131141
type: string
132142
docker:
133-
- image: debian:buster
143+
- image: redisfab/rmbuilder:6.2.1-x64-buster
134144
steps:
135145
- platforms-build-steps:
136146
platform: <<parameters.platform>>
@@ -139,7 +149,8 @@ jobs:
139149
macos:
140150
xcode: 11.3.0
141151
steps:
142-
- build-steps
152+
- build-steps:
153+
make_bin: gmake
143154

144155

145156
on-any-branch: &on-any-branch
@@ -209,7 +220,7 @@ workflows:
209220
<<: *on-any-branch
210221
- platforms-build:
211222
context: common
212-
<<: *on-integ-and-version-tags
223+
<<: *on-any-branch
213224
matrix:
214225
parameters:
215226
platform: [focal, bionic, xenial, centos7]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ endif
8787
test: cargo_test
8888

8989
cargo_test:
90-
cargo test --all-targets --features test,experimental-api
90+
cargo test --all-targets --features test,experimental-api $(CARGO_FLAGS)
9191

9292
.PHONY: test cargo_test
9393

build/platforms/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OSNICK ?= buster
88

99
REPO=redismodule-rs
1010

11-
REDIS_VER=6.2.2
11+
REDIS_VER=6.2.4
1212

1313
INT_BRANCHES=
1414

tests/utils.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ pub fn start_redis_server_with_module(module_name: &str, port: u16) -> Result<Ch
3030
"so"
3131
};
3232

33+
let mut profile = "debug";
34+
if cfg!(not(debug_assertions)) {
35+
profile = "release";
36+
}
3337
let module_path: PathBuf = [
3438
std::env::current_dir()?,
3539
PathBuf::from(format!(
36-
"target/debug/examples/lib{}.{}",
37-
module_name, extension
40+
"target/{}/examples/lib{}.{}",
41+
profile, module_name, extension
3842
)),
3943
]
4044
.iter()
@@ -57,7 +61,7 @@ pub fn start_redis_server_with_module(module_name: &str, port: u16) -> Result<Ch
5761
.args(args)
5862
.spawn()
5963
.map(|c| ChildGuard {
60-
name: "redis_server",
64+
name: "redis-server",
6165
child: c,
6266
})?;
6367

0 commit comments

Comments
 (0)