Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions .github/actions/install-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: Install Server
description: "Build and install Valkey server binaries."

inputs:
os:
description: "The current operating system (see 'os-matrix.json')"
required: true
Comment thread
currantw marked this conversation as resolved.
target:
description: "Specified target for rust toolchain (see 'os-matrix.json')"
required: true
server-version:
description: "Server version to install (see 'server-matrix.json')"
required: true
Expand All @@ -18,16 +12,13 @@ runs:
- name: Set environment variables
shell: bash
env:
OS: ${{ inputs.os }}
SERVER_VERSION: ${{ inputs.server-version }}
run: |
echo "OS=$OS" >> $GITHUB_ENV
echo "SERVER_VERSION=$SERVER_VERSION" >> $GITHUB_ENV
run: echo "SERVER_VERSION=$SERVER_VERSION" >> $GITHUB_ENV

# Environment variables must be passed into WSL explicitly using the WSLENV environment variable.
# The '/p' flag translates the $GITHUB_ENV path from Windows to WSL format.
- name: Pass environment variables to WSL
if: ${{ inputs.os == 'windows' }}
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
echo "WSLENV=SERVER_VERSION:GITHUB_ENV/p" >> $GITHUB_ENV
Expand All @@ -53,11 +44,11 @@ runs:
path: |
valkey/src/valkey-cli
valkey/src/valkey-server
key: valkey-${{ env.SOURCE_VERSION }}-${{ inputs.target }}
key: valkey-${{ env.SOURCE_VERSION }}-${{ runner.os }}-${{ runner.arch }}

Comment thread
currantw marked this conversation as resolved.
- name: Build and install Valkey binaries from source
if: ${{ steps.cache-valkey.outputs.cache-hit != 'true' }}
shell: ${{ inputs.os == 'windows' && 'wsl-bash {0}' || 'bash' }}
shell: ${{ runner.os == 'Windows' && 'wsl-bash {0}' || 'bash' }}
run: |
git clone --depth 1 --branch "$SERVER_VERSION" --single-branch 'https://github.com/valkey-io/valkey.git'

Expand All @@ -66,12 +57,12 @@ runs:

- name: Install Valkey binaries from cache
if: ${{ steps.cache-valkey.outputs.cache-hit == 'true' }}
shell: ${{ inputs.os == 'windows' && 'wsl-bash {0}' || 'bash' }}
shell: ${{ runner.os == 'Windows' && 'wsl-bash {0}' || 'bash' }}
run: |
sudo cp valkey/src/valkey-cli valkey/src/valkey-server /usr/local/bin

- name: Verify Valkey installation
shell: ${{ inputs.os == 'windows' && 'wsl-bash {0}' || 'bash' }}
shell: ${{ runner.os == 'Windows' && 'wsl-bash {0}' || 'bash' }}
run: |
if [ ! -f /usr/local/bin/valkey-cli ] || [ ! -f /usr/local/bin/valkey-server ]; then
echo "Error: Valkey installation failed."
Expand Down
12 changes: 5 additions & 7 deletions .github/actions/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ runs:
yum install -y gcc pkgconfig openssl openssl-devel which curl gettext libasan tar --allowerasing

# In Windows runners, the Valkey servers run within WSL.
# These can be accessed via the WSL bash shell.
# See <https://github.com/Vampire/setup-wsl> for more details.
# WSL2 is not available on windows-11-arm runners (no Hyper-V), so skip for aarch64.
# - Use WSL bash shell – see <https://github.com/Vampire/setup-wsl>.
# - WSL is not available on Windows ARM runners – see #383.
- name: Install software dependencies for Windows
if: "${{ inputs.os == 'windows' && !contains(inputs.target, 'aarch64') }}"
if: "${{ runner.os == 'Windows' && runner.arch != 'ARM64' }}"
uses: Vampire/setup-wsl@v7
Comment thread
currantw marked this conversation as resolved.
Outdated
with:
distribution: Ubuntu-22.04
Expand All @@ -55,12 +54,11 @@ runs:

# Always build from source first. This installs 'valkey-cli', which is
# needed by 'start-valkey-docker' to start servers in Docker.
# Valkey servers cannot be install on Windows ARM runners - see #383.
Comment thread
currantw marked this conversation as resolved.
Outdated
- name: Install server from source
if: "${{ inputs.server-version }}"
if: "${{ inputs.server-version && !(runner.os == 'Windows' && runner.arch == 'ARM64') }}"
uses: ./.github/actions/install-server
with:
os: ${{ inputs.os }}
target: ${{ inputs.target }}
server-version: ${{ inputs.server-version }}

# For valkey 9.0 on ubuntu, also start Docker containers with the
Expand Down
8 changes: 4 additions & 4 deletions .github/json_matrices/load_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def main() -> None:
profile = sys.argv[1]

os_matrix = filter_by_profile(load_json("os-matrix.json"), profile)
host = [h for h in os_matrix if "IMAGE" not in h]
container_host = [h for h in os_matrix if "IMAGE" in h]
host = [h for h in os_matrix if "image" not in h]
container_host = [h for h in os_matrix if "image" in h]

server = filter_by_profile(load_json("server-matrix.json"), profile)
assert server, "Given profile resulted in empty server matrix."

dotnet_entries = filter_by_profile(load_json("version-matrix.json"), profile)
dotnet = [e["version"] for e in dotnet_entries]
assert dotnet, "Given profile resulted in empty dotnet version matrix."
Expand All @@ -54,7 +54,7 @@ def main() -> None:
if github_output:
with open(github_output, "a") as f:
for key, value in configs.items():
print(f"{key}={value}", file=f)
print(f"{key}={value}", file=f)
else:
for key, value in configs.items():
print(f"{key}={value}")
Expand Down
54 changes: 23 additions & 31 deletions .github/json_matrices/os-matrix.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,45 @@
[
{
"OS": "ubuntu",
"RUNNER": "ubuntu-24.04",
"ARCH": "x64",
Comment thread
currantw marked this conversation as resolved.
"TARGET": "x86_64-unknown-linux-gnu",
"os": "ubuntu",
"runner": "ubuntu-24.04",
"target": "x86_64-unknown-linux-gnu",
"profiles": [ "standard", "full"]
Comment thread
currantw marked this conversation as resolved.
},
{
"OS": "ubuntu",
"RUNNER": "ubuntu-24.04-arm",
"ARCH": "arm64",
"TARGET": "aarch64-unknown-linux-gnu",
"os": "ubuntu",
"runner": "ubuntu-24.04-arm",
"target": "aarch64-unknown-linux-gnu",
"profiles": [ "full"]
},
{
"OS": "amazon-linux",
"RUNNER": "ubuntu-latest",
"ARCH": "x64",
"TARGET": "x86_64-unknown-linux-gnu",
"IMAGE": "amazonlinux:latest",
"os": "amazon-linux",
"runner": "ubuntu-latest",
"target": "x86_64-unknown-linux-gnu",
"image": "amazonlinux:latest",
"profiles": ["full"]
},
{
"OS": "macos",
"RUNNER": "macos-15",
"ARCH": "arm64",
"TARGET": "aarch64-apple-darwin",
"os": "macos",
"runner": "macos-15",
"target": "aarch64-apple-darwin",
"profiles": [ "full"]
},
{
"OS": "macos",
"NAMED_OS": "darwin",
Comment thread
currantw marked this conversation as resolved.
"RUNNER": "macos-15-intel",
"ARCH": "x64",
"TARGET": "x86_64-apple-darwin",
"os": "macos",
"runner": "macos-15-intel",
"target": "x86_64-apple-darwin",
"profiles": [ "full"]
},
{
"OS": "windows",
"RUNNER": "windows-2025",
"ARCH": "x64",
"TARGET": "x86_64-pc-windows-msvc",
"os": "windows",
"runner": "windows-2025",
"target": "x86_64-pc-windows-msvc",
"profiles": [ "standard", "full"]
},
{
"OS": "windows",
"RUNNER": "windows-11-arm",
"ARCH": "arm64",
"TARGET": "aarch64-pc-windows-msvc",
"profiles": []
"os": "windows",
"runner": "windows-11-arm",
"target": "aarch64-pc-windows-msvc",
"profiles": ["standard", "full"]
}
]
26 changes: 13 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
working-directory: .github/json_matrices
# Select all VM runners (non-container) — each produces a unique native binary for the NuGet package.
run: |
PLATFORM_MATRIX=$(jq -c '[.[] | select(has("IMAGE") | not)]' < os-matrix.json)
PLATFORM_MATRIX=$(jq -c '[.[] | select(has("image") | not)]' < os-matrix.json)
echo "PLATFORM_MATRIX=$PLATFORM_MATRIX" | tee -a "$GITHUB_OUTPUT"

set-release-version:
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
fail-fast: false
matrix:
host: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }}
runs-on: ${{ matrix.host.RUNNER }}
runs-on: ${{ matrix.host.runner }}

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -94,36 +94,36 @@ jobs:
- name: Install shared software dependencies
uses: ./.github/actions/install-shared-dependencies
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
os: ${{ matrix.host.os }}
target: ${{ matrix.host.target }}

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: rust/target
key: rust-${{ matrix.host.TARGET }}
key: rust-${{ matrix.host.target }}

- name: Build native libs (linux gnu)
if: ${{ contains(matrix.host.TARGET, 'linux-gnu') }}
if: ${{ contains(matrix.host.target, 'linux-gnu') }}
working-directory: rust
run: |
cargo zigbuild -r --target ${{ matrix.host.TARGET }}.2.17
cargo zigbuild -r --target ${{ matrix.host.target }}.2.17
mkdir -p target/release

- name: Build native libs
if: ${{ !contains(matrix.host.TARGET, 'linux-gnu') }}
if: ${{ !contains(matrix.host.target, 'linux-gnu') }}
working-directory: rust
run: cargo build --release --target ${{ matrix.host.TARGET }}
run: cargo build --release --target ${{ matrix.host.target }}

- name: Upload artifacts to publish
continue-on-error: true
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.host.TARGET }}
name: ${{ matrix.host.target }}
if-no-files-found: error
path: |
rust/target/${{ matrix.host.TARGET }}/release/*.so
rust/target/${{ matrix.host.TARGET }}/release/*.dylib
rust/target/${{ matrix.host.TARGET }}/release/*.dll
rust/target/${{ matrix.host.target }}/release/*.so
rust/target/${{ matrix.host.target }}/release/*.dylib
rust/target/${{ matrix.host.target }}/release/*.dll

build-package-to-publish:
needs: [set-release-version, create-binaries]
Expand Down
Loading
Loading