Skip to content

Commit

Permalink
Fix testing deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Guian Gumpac <guian.gumpac@improving.com>
  • Loading branch information
GumpacG committed Sep 18, 2024
1 parent c672c62 commit 5b929ef
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ inputs:
required: true
type: string

use-cache:
description: "Uses installed Valkey from cache"
required: false
default: true
type: boolean


runs:
using: "composite"
Expand All @@ -48,7 +54,7 @@ runs:
run: |
sudo apt update -y
sudo apt install -y git gcc pkg-config openssl libssl-dev
- name: Install software dependencies for Ubuntu MUSL
shell: bash
if: "${{ contains(inputs.target, 'musl') }}"
Expand Down Expand Up @@ -76,3 +82,4 @@ runs:
with:
engine-version: ${{ inputs.engine-version }}
target: ${{ inputs.target }}
use-cache: ${{ inputs.use-cache }}
15 changes: 10 additions & 5 deletions .github/workflows/install-valkey/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ inputs:
- aarch64-apple-darwin
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
use-cache:
description: "Uses installed Valkey from cache"
required: false
default: true
type: boolean

env:
CARGO_TERM_COLOR: always
Expand All @@ -26,8 +31,8 @@ runs:

steps:
- name: Cache Valkey
# TODO: remove the musl ARM64 limitation when https://github.com/actions/runner/issues/801 is resolved
if: ${{ inputs.target != 'aarch64-unknown-linux-musl' }}
# TODO: remove the musl ARM64 limitation when https://github.com/actions/runner/issues/801 is resolved
if: ${{ inputs.use-cache == true && inputs.target != 'aarch64-unknown-linux-musl' }}
uses: actions/cache@v4
id: cache-valkey
with:
Expand All @@ -38,7 +43,7 @@ runs:
- name: Build Valkey
if: ${{ steps.cache-valkey.outputs.cache-hit != 'true' }}
shell: bash
run: |
run: |
echo "Building valkey ${{ inputs.engine-version }}"
cd ~
rm -rf valkey
Expand All @@ -64,7 +69,7 @@ runs:
- name: Verify Valkey installation and symlinks
if: ${{ !contains(inputs.engine-version, '-rc') }}
shell: bash
run: |
run: |
# In Valkey releases, the engine is built with symlinks from valkey-server and valkey-cli
# to redis-server and redis-cli. This step ensures that the engine is properly installed
# with the expected version and that Valkey symlinks are correctly created.
Expand All @@ -76,4 +81,4 @@ runs:
else
echo "Successfully installed the server: $INSTALLED_VER"
fi
37 changes: 27 additions & 10 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,10 @@ jobs:
fail-fast: false
matrix:
host: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }}

runs-on: ${{ matrix.host.RUNNER }}
steps:
- name: Start Valkey server
uses: ./.github/actions/install-valkey
with:
engine-version: "7.2.5"
target: ${{ matrix.host.TARGET }}

- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -244,22 +238,46 @@ jobs:
uses: ./.github/workflows/install-shared-dependencies
with:
os: ${{ matrix.host.OS }}
engine-version: "7.2.5"
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
use-cache: false

- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "26.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Find available port
id: port
run: |
if ${{ matrix.host.OS == 'ubuntu'}}; then
sudo apt install net-tools
while
port=$(shuf -n 1 -i 40000-65000)
netstat -atun | grep -q "$port"
do
continue
done
else
export port=`comm -23 <(seq 49152 65535 | sort) <(awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1`
fi
echo "PORT=$port" >> $GITHUB_OUTPUT
- name: Start Valkey server
run:
cd ~/valkey/src
./valkey-server --port ${{ steps.port.outputs.PORT }}&

- name: Test deployment
working-directory: java
run: |
export ORG_GRADLE_PROJECT_centralManualTestingAuthHeaderName="Authorization"
export ORG_GRADLE_PROJECT_centralManualTestingAuthHeaderValue="Bearer $(echo "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" | base64)"
export GLIDE_RELEASE_VERSION=${{ env.RELEASE_VERSION }}
./gradlew :benchmarks:run --args="--minimal --clients glide"
./gradlew :benchmarks:run --args="--minimal --clients glide --port ${{ env.VALKEY_PORT }}"
publish-release-to-maven:
if: ${{ inputs.maven_publish == true || github.event_name == 'push' }}
Expand Down Expand Up @@ -287,4 +305,3 @@ jobs:
curl --request DELETE \
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"

0 comments on commit 5b929ef

Please sign in to comment.