diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index a4939af8be..a2eb071173 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -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 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f81773c0d8..145520b30c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -91,7 +91,7 @@ jobs: os: ${{ matrix.host.OS }} target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} - install-redis: 'false' + install-redis: ${{ ((matrix.engine.type == 'valkey' || matrix.host.OS == 'ubuntu') && 'false') || 'true' }} - name: Install tools for Go ${{ matrix.go }} working-directory: ./go diff --git a/.github/workflows/install-shared-dependencies/action.yml b/.github/workflows/install-shared-dependencies/action.yml index 98ca63cc32..6adbce4fe3 100644 --- a/.github/workflows/install-shared-dependencies/action.yml +++ b/.github/workflows/install-shared-dependencies/action.yml @@ -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 @@ -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 @@ -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') }}" diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index b5c02df611..c0f06fce44 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -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 @@ -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