Skip to content

Commit

Permalink
Skip redis installation via package manager option
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Jun 13, 2024
1 parent a8ac02b commit 9fbf1d7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
install-redis: ${{ ((matrix.engine.type == 'valkey' || matrix.host.OS == 'ubuntu') && 'false') || 'true' }}

- name: Format
working-directory: ./csharp
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
install-redis: ${{ ((matrix.engine.type == 'valkey' || matrix.host.OS == 'ubuntu') && 'false') || 'true' }}

- name: Install tools for Go ${{ matrix.go }}
working-directory: ./go
Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ inputs:
- aarch64-apple-darwin
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
install-redis:
description: "Indicates if redis should be installed from the package manager"
required: false
type: boolean
default: "true"

github-token:
description: "GITHUB_TOKEN, GitHub App installation access token"
required: true
Expand All @@ -36,7 +42,12 @@ runs:
run: |
brew update
brew upgrade || true
brew install git gcc pkgconfig openssl redis coreutils
brew install git gcc pkgconfig openssl coreutils
if [ "${{ inputs.install-redis }}" == 'true' ]; then
brew install redis
else
echo "Skipping Redis installation via package manager"
fi
- name: Install software dependencies for Ubuntu GNU
shell: bash
Expand All @@ -52,13 +63,23 @@ runs:
apk update
wget -O - https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
apk add protobuf-dev musl-dev make gcc redis envsubst
apk add protobuf-dev musl-dev make gcc envsubst
if [ "${{ inputs.install-redis }}" == 'true' ]; then
apk add redis
else
echo "Skipping Redis installation via package manager"
fi
- name: Install software dependencies for Amazon-Linux
shell: bash
if: "${{ inputs.os == 'amazon-linux' }}"
run: |
yum install -y gcc pkgconfig openssl openssl-devel which curl redis6 gettext --allowerasing
yum install -y gcc pkgconfig openssl openssl-devel which curl gettext --allowerasing
if [ "${{ inputs.install-redis }}" == 'true' ]; then
yum install -y redis6 --allowerasing
else
echo "Skipping Redis installation via package manager"
fi
- name: Install Rust toolchain and protoc
if: "${{ !contains(inputs.target, 'musl') }}"
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ jobs:
distribution: "temurin"
java-version: ${{ matrix.java }}

- name: Install shared software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install redis
if: ${{ matrix.engine.type == 'redis' && matrix.host.OS == 'ubuntu' }}
# TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781
Expand All @@ -103,6 +90,20 @@ jobs:
with:
valkey-version: ${{ matrix.engine.version }}
target: ${{ matrix.host.TARGET }}

- name: Install shared software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
install-redis: ${{ ((matrix.engine.type == 'valkey' || matrix.host.OS == 'ubuntu') && 'false') || 'true' }}

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

- name: Build java client
working-directory: java
Expand Down

0 comments on commit 9fbf1d7

Please sign in to comment.