Skip to content

Commit e232623

Browse files
authored
MOD-5869: Support mariner2 via github actions (RedisJSON#1102)
* Support mariner2 via github actions
1 parent 0c86f9c commit e232623

File tree

5 files changed

+84
-17
lines changed

5 files changed

+84
-17
lines changed

.github/workflows/mariner2.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build for mariner2
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: ubuntu-latest
13+
defaults:
14+
run:
15+
shell: bash -l -eo pipefail {0}
16+
container:
17+
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
18+
steps:
19+
- name: Install prereqs
20+
run: |
21+
tdnf install --noplugins --skipsignature -y ca-certificates git
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: 'recursive'
26+
- name: Install dependencies
27+
run: |
28+
bash .install/mariner2.sh
29+
- name: Get Redis
30+
uses: actions/checkout@v4
31+
with:
32+
repository: redis/redis
33+
ref: '7.2.1'
34+
path: redis
35+
- name: Build Redis
36+
working-directory: redis
37+
run: make install
38+
- name: Build module
39+
run: |
40+
make build
41+
- name: Test
42+
run: |
43+
make test
44+
- name: Pack module
45+
run: |
46+
make pack BRANCH=${{ github.ref_name }}
47+
- name: Configure AWS credentials
48+
uses: aws-actions/configure-aws-credentials@v4
49+
with:
50+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
51+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52+
aws-region: "us-east-1"
53+
- name: Upload artifacts to S3 - staging
54+
run: |
55+
make upload-artifacts SHOW=1 STAGING=1 VERBOSE=1
56+
- name: Upload artifacts to S3 - release # todo: trigger this manually instead
57+
if: ${{ github.ref != 'refs/heads/master' }}
58+
run: make upload-artifacts SHOW=1 VERBOSE=1

.install/mariner2.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
tdnf install -q -y build-essential git wget ca-certificates tar openssl-devel \
4+
cmake python3 python3-pip rust clang which unzip
5+
6+
pip install -q --upgrade setuptools
7+
pip install -q --upgrade pip
8+
pip install -q -r tests/pytest/requirements.txt
9+
10+
# These packages are needed to build the package
11+
pip install -q addict toml jinja2 ramp-packer
12+
13+
# Install aws-cli for uploading artifacts to s3
14+
curdir="$PWD"
15+
cd /tmp/
16+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
17+
unzip awscliv2.zip
18+
./aws/install
19+
cd $curdir

sbin/upload-artifacts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,9 @@ else
6666
S3_URL=s3://redismodules
6767
fi
6868

69-
if [[ $FORCE != 1 ]]; then
70-
if [[ -z $CIRCLECI ]]; then
71-
eprint "Cannot upload outside of CircleCI. Override with FORCE=1."
72-
exit 1
73-
fi
74-
75-
if [[ -z $AWS_ACCESS_KEY_ID || -z $AWS_SECRET_ACCESS_KEY ]]; then
76-
eprint "No credentials for S3 upload."
77-
exit 1
78-
fi
69+
if [[ -z $AWS_ACCESS_KEY_ID || -z $AWS_SECRET_ACCESS_KEY ]]; then
70+
eprint "No credentials for S3 upload."
71+
exit 1
7972
fi
8073

8174
cd $ROOT/bin
@@ -96,7 +89,7 @@ s3_upload_file() {
9689
local s3_dir="$2"
9790
[[ $s3_dir != */ ]] && s3_dir="${s3_dir}/"
9891

99-
$OP aws s3 cp $file $s3_dir --acl public-read --no-progress
92+
$OP aws --debug s3 cp $file $s3_dir --acl public-read --no-progress
10093
}
10194

10295
s3_ls() {

tests/pytest/requirements.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# redis ~= 5.0.0b3
2-
# RLTest ~= 0.7.0
3-
# ramp-packer ~= 2.5.4
4-
# psutil >= 5.8.0
5-
1+
RLTest ~= 0.7.2
62
six >= 1.10.0
7-
gevent ~= 22.10.1
3+
gevent >= 23.9.1

tests/pytest/tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ setup_rltest() {
156156
if [[ $RLTEST_CONSOLE == 1 ]]; then
157157
RLTEST_ARGS+=" -i"
158158
fi
159+
RLTEST_ARGS+=" --enable-debug-command --enable-protected-configs"
159160
}
160161

161162
#----------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy