Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e9a901

Browse files
[2.8] cherry-pick #1220 (#1223)
* initial commit (cherry picked from commit 52aa9a6) * modify default flow to check that run build scripts for all platforms works (cherry picked from commit 7c65f7e) * modify default flow to check that uploading artifacts to staging lab works (cherry picked from commit 9bf11a1) * moving to GHA (cherry picked from commit 917cae5) * fix (cherry picked from commit f7bfdde) * fix (cherry picked from commit e8700ae) * fix (cherry picked from commit e16669e) * fix (cherry picked from commit 1553712) * add RLTest (cherry picked from commit b38e2ef) * fix (cherry picked from commit 037d8e7) * fix name (cherry picked from commit 9ba1f23) * actually do the installation (cherry picked from commit 2c3e79b) * json calls it pytest (singular) (cherry picked from commit 659024b) * json calls it pytest (singular) (cherry picked from commit 4356ea8) * more dependencies (cherry picked from commit af7ef5e) * removing macos-x64 flow from circleci (cherry picked from commit 4999232) * set new flow to run only on master and tag branches (cherry picked from commit 1aae055)
1 parent 15a343f commit 3e9a901

File tree

6 files changed

+163
-33
lines changed

6 files changed

+163
-33
lines changed

.circleci/config.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -319,28 +319,6 @@ jobs:
319319
- vm-build-platforms-steps:
320320
platform: <<parameters.platform>>
321321

322-
build-macos-x64:
323-
macos:
324-
xcode: 13.4.1
325-
resource_class: macos.x86.medium.gen2
326-
parameters:
327-
upload:
328-
type: string
329-
default: "yes"
330-
steps:
331-
- early-returns
332-
- build-steps
333-
- test-steps
334-
- persist-artifacts
335-
- run:
336-
name: Upload artifacts to S3
337-
command: |
338-
if [[ -n $CIRCLE_BRANCH ]]; then
339-
make upload-artifacts SHOW=1
340-
else
341-
make upload-release SHOW=1
342-
fi
343-
344322
build-macos-m1:
345323
macos:
346324
xcode: 14.2.0
@@ -532,9 +510,6 @@ workflows:
532510
matrix:
533511
parameters:
534512
platform: [jammy, focal, bionic]
535-
- build-macos-x64:
536-
<<: *on-integ-and-version-tags
537-
context: common
538513
- build-macos-m1:
539514
context: common
540515
<<: *on-integ-and-version-tags
@@ -554,7 +529,6 @@ workflows:
554529
requires:
555530
- build-platforms
556531
- build-arm-platforms
557-
- build-macos-x64
558532
- build-macos-m1
559533
- upload-artifacts:
560534
name: upload-release-artifacts
@@ -563,7 +537,6 @@ workflows:
563537
requires:
564538
- build-platforms
565539
- build-arm-platforms
566-
- build-macos-x64
567540
- build-macos-m1
568541
- release-qa-tests:
569542
<<: *on-version-tags
@@ -588,9 +561,6 @@ workflows:
588561
when:
589562
<< pipeline.parameters.run_nightly_twice_a_week_flow_label >>
590563
jobs:
591-
- build-macos-x64:
592-
context: common
593-
upload: "yes"
594564
- build-macos-m1:
595565
context: common
596566
upload: "yes"
@@ -601,9 +571,6 @@ workflows:
601571
cron: "20 17 * * 0,3"
602572
<<: *on-integ-branch-cron
603573
jobs:
604-
- build-macos-x64:
605-
context: common
606-
upload: "yes"
607574
- build-macos-m1:
608575
context: common
609576
upload: "yes"
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build for macos
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v[0-9]+.[0-9]+.[0-9]+'
9+
10+
jobs:
11+
build:
12+
runs-on: macos-12
13+
defaults:
14+
run:
15+
shell: bash -l -eo pipefail {0}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: 'recursive'
21+
- name: Deps checkout
22+
uses: actions/checkout@v3
23+
with:
24+
path: setup
25+
sparse-checkout-cone-mode: false
26+
sparse-checkout: |
27+
.install
28+
tests/pytest/requirements.*
29+
- name: Setup specific
30+
working-directory: setup/.install
31+
run: ./install_script.sh ${{ steps.mode.outputs.mode }}
32+
- name: Full checkout
33+
uses: actions/checkout@v3
34+
with:
35+
submodules: recursive
36+
- name: Setup common
37+
run: .install/common_installations.sh ${{ steps.mode.outputs.mode }}
38+
39+
- name: Get Redis
40+
uses: actions/checkout@v4
41+
with:
42+
repository: redis/redis
43+
ref: 'unstable' # todo change per version/tag
44+
path: redis
45+
- name: Build Redis
46+
working-directory: redis
47+
run: make install
48+
- name: Build module
49+
run: |
50+
make build
51+
- name: Test
52+
run: |
53+
make test
54+
- name: Pack module
55+
run: |
56+
make pack BRANCH=${{ github.ref_name }}
57+
- name: Configure AWS credentials
58+
uses: aws-actions/configure-aws-credentials@v4
59+
with:
60+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
61+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
62+
aws-region: "us-east-1"
63+
- name: Upload artifacts to S3 - staging
64+
run: |
65+
make upload-artifacts SHOW=1 VERBOSE=1
66+
make upload-release SHOW=1 STAGING=1 VERBOSE=1
67+
- name: Upload artifacts to S3 - release # todo: trigger this manually instead
68+
if: ${{ github.ref != 'refs/heads/master' }}
69+
run: make upload-release SHOW=1 VERBOSE=1

.install/common_installations.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
set -e
3+
OS_TYPE=$(uname -s)
4+
MODE=$1 # whether to install using sudo or not
5+
6+
activate_venv() {
7+
echo "copy ativation script to shell config"
8+
if [[ $OS_TYPE == Darwin ]]; then
9+
echo "source venv/bin/activate" >> ~/.bashrc
10+
echo "source venv/bin/activate" >> ~/.zshrc
11+
else
12+
echo "source $PWD/venv/bin/activate" >> ~/.bash_profile
13+
fi
14+
}
15+
16+
python3 -m venv venv
17+
activate_venv
18+
source venv/bin/activate
19+
20+
pip install --upgrade pip
21+
pip install -q --upgrade setuptools
22+
echo "pip version: $(pip --version)"
23+
echo "pip path: $(which pip)"
24+
25+
pip install -q -r tests/pytest/requirements.txt
26+
# These packages are needed to build the package
27+
pip install -q addict toml jinja2 ramp-packer
28+
29+
# List installed packages
30+
pip list

.install/install_cmake.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
version=3.25.1
3+
processor=$(uname -m)
4+
OS_TYPE=$(uname -s)
5+
MODE=$1 # whether to install using sudo or not
6+
7+
if [[ $OS_TYPE = 'Darwin' ]]
8+
then
9+
brew install cmake
10+
else
11+
if [[ $processor = 'x86_64' ]]
12+
then
13+
filename=cmake-${version}-linux-x86_64.sh
14+
else
15+
filename=cmake-${version}-linux-aarch64.sh
16+
fi
17+
18+
wget https://github.com/Kitware/CMake/releases/download/v${version}/${filename}
19+
chmod u+x ./${filename}
20+
$MODE ./${filename} --skip-license --prefix=/usr/local --exclude-subdir
21+
cmake --version
22+
fi

.install/install_script.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
OS_TYPE=$(uname -s)
4+
MODE=$1 # whether to install using sudo or not
5+
6+
if [[ $OS_TYPE = 'Darwin' ]]
7+
then
8+
OS='macos'
9+
else
10+
VERSION=$(grep '^VERSION_ID=' /etc/os-release | sed 's/"//g')
11+
VERSION=${VERSION#"VERSION_ID="}
12+
OS_NAME=$(grep '^NAME=' /etc/os-release | sed 's/"//g')
13+
OS_NAME=${OS_NAME#"NAME="}
14+
[[ $OS_NAME == 'Rocky Linux' ]] && VERSION=${VERSION%.*} # remove minor version for Rocky Linux
15+
OS=${OS_NAME,,}_${VERSION}
16+
OS=$(echo $OS | sed 's/[/ ]/_/g') # replace spaces and slashes with underscores
17+
fi
18+
echo $OS
19+
20+
source ${OS}.sh $MODE
21+
22+
git config --global --add safe.directory '*'

.install/macos.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
export HOMEBREW_NO_AUTO_UPDATE=1
4+
BREW_PREFIX=$(brew --prefix)
5+
GNUBIN=$BREW_PREFIX/opt/make/libexec/gnubin
6+
LLVM=$BREW_PREFIX/opt/llvm@16/bin
7+
COREUTILS=$BREW_PREFIX/opt/coreutils/libexec/gnubin
8+
9+
brew update
10+
brew install coreutils
11+
brew install make
12+
brew install llvm@16
13+
14+
echo "export PATH=$COREUTILS:$LLVM:$GNUBIN:$PATH" >> ~/.bashrc
15+
echo "export PATH=$COREUTILS:$LLVM:$GNUBIN:$PATH" >> ~/.zshrc
16+
source ~/.bashrc
17+
source ~/.zshrc
18+
19+
brew install openssl
20+
source install_cmake.sh

0 commit comments

Comments
 (0)