Skip to content

Commit 8461bae

Browse files
authored
CircleCI modifications (#185)
* CircleCI modifications * fixes 1 * fixes 2
1 parent 44a7826 commit 8461bae

File tree

3 files changed

+61
-43
lines changed

3 files changed

+61
-43
lines changed

.circleci/config.yml

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
version: 2.1
22

33
commands:
4-
abort-for-docs:
4+
early-returns:
55
steps:
66
- run:
7-
name: Avoid tests for docs
7+
name: Early return if this is a docs build
88
command: |
9-
if [[ $CIRCLE_BRANCH == *_docs ]]; then
10-
echo "Identifies as documents PR, no testing required"
9+
if [[ $CIRCLE_BRANCH == *docs ]]; then
10+
echo "Identifies as documents PR, no testing required."
11+
circleci step halt
12+
fi
13+
- run:
14+
name: Early return if this branch should ignore CI
15+
command: |
16+
if [[ $CIRCLE_BRANCH == *noci ]]; then
17+
echo "Identifies as actively ignoring CI, no testing required."
1118
circleci step halt
1219
fi
1320
@@ -33,8 +40,16 @@ commands:
3340
apt-get -q install -y git openssh-client curl ca-certificates make tar gzip
3441
bash <(curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh)
3542
- setup_remote_docker:
43+
version: 20.10.2
3644
docker_layer_caching: true
3745

46+
checkout-all:
47+
steps:
48+
- checkout
49+
- run:
50+
name: Checkout submodules
51+
command: git submodule update --init --recursive
52+
3853
setup-automation:
3954
steps:
4055
- run:
@@ -43,29 +58,29 @@ commands:
4358
(mkdir -p deps; cd deps; git clone https://github.com/RedisLabsModules/readies.git)
4459
./deps/readies/bin/getpy3
4560
46-
setup-build-environment:
61+
install-prerequisites:
62+
parameters:
63+
redis_version:
64+
type: string
65+
default: "6"
66+
getredis_params:
67+
type: string
68+
default: ""
4769
steps:
70+
- setup-automation
4871
- run:
4972
name: Setup build environment
5073
command: |
5174
./sbin/system-setup.py
52-
source $HOME/.cargo/env
53-
rustc --version
54-
cargo --version
55-
rustup --version
56-
57-
checkout-all:
58-
steps:
59-
- checkout
75+
bash -l -c "make info"
6076
- run:
61-
name: Checkout submodules
62-
command: git submodule update --init --recursive
77+
name: Install Redis
78+
command: |
79+
bash -l -c "./deps/readies/bin/getredis -v \"<<parameters.redis_version>>\" --force <<parameters.getredis_params>>"
80+
redis-server --version
6381
6482
build-steps:
6583
parameters:
66-
make_bin:
67-
type: string
68-
default: "make"
6984
build_params:
7085
type: string
7186
default: ""
@@ -79,54 +94,48 @@ commands:
7994
type: string
8095
default: ""
8196
steps:
82-
- abort-for-docs
97+
- early-returns
8398
- checkout-all
84-
- setup-automation
85-
- run:
86-
name: Setup build environment
87-
command: |
88-
./sbin/system-setup.py
89-
source $HOME/.cargo/env
90-
rustc --version
91-
cargo --version
92-
rustup --version
99+
- install-prerequisites:
100+
redis_version: <<parameters.redis_version>>
101+
getredis_params: <<parameters.getredis_params>>
93102
- restore_cache:
94103
keys:
95104
- v3-dependencies-{{ arch }}-{{ checksum "Cargo.toml" }}
96-
# fallback to using the latest cache if no exact match is found
97105
#- run:
98106
# name: Check formatting
99107
# command: bash -l -c "make lint"
100108
- run:
101109
name: Build debug
102-
command: bash -l -c "<<parameters.make_bin>> build DEBUG=1 <<parameters.build_params>>"
110+
command: bash -l -c "make build DEBUG=1 <<parameters.build_params>>"
103111
- run:
104112
name: Build release
105-
command: bash -l -c "<<parameters.make_bin>> build <<parameters.build_params>>"
113+
command: bash -l -c "make build <<parameters.build_params>>"
106114
- save_cache:
107115
key: v3-dependencies-{{ arch }}-{{ checksum "Cargo.toml" }}
108116
paths:
109117
- "~/.cargo"
110118
- "./target"
111119
- run:
112120
name: Run all tests
113-
command: bash -l -c "<<parameters.make_bin>> test"
121+
command: bash -l -c "make test"
114122

115123
platforms-build-steps:
116124
parameters:
117125
platform:
118126
type: string
119127
steps:
120-
- abort-for-docs
128+
- early-returns
121129
- setup-executor
122130
- checkout-all
123131
- setup-automation
124-
- setup-build-environment
125132
- run:
126133
name: Build for platform
127134
command: |
128135
cd build/platforms
129-
make build OSNICK=<<parameters.platform>> VERSION=$CIRCLE_TAG BRANCH=$CIRCLE_BRANCH TEST=1 SHOW=1
136+
make build OSNICK="<<parameters.platform>>" VERSION="$CIRCLE_TAG" BRANCH="$CIRCLE_BRANCH" TEST=1 SHOW=1
137+
138+
#----------------------------------------------------------------------------------------------------------------------------------
130139

131140
#----------------------------------------------------------------------------------------------------------------------------------
132141

@@ -142,17 +151,16 @@ jobs:
142151
platform:
143152
type: string
144153
docker:
145-
- image: ubuntu:bionic
154+
- image: debian:buster
146155
steps:
147156
- platforms-build-steps:
148157
platform: <<parameters.platform>>
149158

150159
build-macos:
151160
macos:
152-
xcode: 11.3.0
161+
xcode: 11.6.0
153162
steps:
154-
- build-steps:
155-
make_bin: gmake
163+
- build-steps
156164

157165
#----------------------------------------------------------------------------------------------------------------------------------
158166

@@ -221,12 +229,12 @@ workflows:
221229
default-flow:
222230
jobs:
223231
- build:
224-
<<: *on-any-branch
232+
<<: *not-on-integ-branch
225233
- platforms-build:
226234
context: common
227-
<<: *on-any-branch
235+
<<: *on-integ-and-version-tags
228236
matrix:
229237
parameters:
230-
platform: [focal, bionic, xenial, centos7]
238+
platform: [focal, bionic, xenial, centos8, centos7, buster]
231239
- build-macos:
232240
<<: *on-any-branch

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redismodule-rs:${VERSION}-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.2.2
3+
ARG REDIS_VER=6.2.5
44

55
# stretch|bionic|buster
66
ARG OSNICK=buster
@@ -28,6 +28,7 @@ WORKDIR /build
2828

2929
RUN ./deps/readies/bin/getpy3
3030
RUN ./sbin/system-setup.py
31+
RUN bash -l -c "make info"
3132
RUN bash -l -c make
3233

3334
RUN set -ex ;\

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,12 @@ platform:
9898
ifeq ($(PUBLISH),1)
9999
@make -C build/platforms publish
100100
endif
101+
102+
info:
103+
gcc --version
104+
cmake --version
105+
clang --version
106+
rustc --version
107+
cargo --version
108+
rustup --version
109+
rustup show

0 commit comments

Comments
 (0)