Skip to content

Commit

Permalink
revert action.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Chloe Yip <[email protected]>
  • Loading branch information
cyip10 committed Sep 17, 2024
1 parent f7c0ada commit 5582c5c
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions .github/workflows/install-valkey/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,53 @@ runs:

steps:
- name: Cache Valkey
# TODO: remove the musl ARM64 limitation when https://github.com/actions/runner/issues/801 is resolved
# TODO: remove the musl ARM64 limitation when https://github.com/actions/runner/issues/801 is resolved
if: ${{ inputs.target != 'aarch64-unknown-linux-musl' }}
uses: actions/cache@v4
id: cache-valkey
with:
path: |
~/valkey
key: valkey-${{ inputs.engine-version }}-${{ inputs.target }}
path: |
~/valkey
key: valkey-${{ inputs.engine-version }}-${{ inputs.target }}

- name: Build Valkey
if: ${{ steps.cache-valkey.outputs.cache-hit != 'true' }}
shell: bash
run: |
echo "Building valkey ${{ inputs.engine-version }}"
cd ~
rm -rf valkey
git clone https://github.com/valkey-io/valkey.git
cd valkey
git checkout ${{ inputs.engine-version }}
make BUILD_TLS=yes
echo "Building valkey ${{ inputs.engine-version }}"
cd ~
rm -rf valkey
git clone https://github.com/valkey-io/valkey.git
cd valkey
git checkout ${{ inputs.engine-version }}
make BUILD_TLS=yes
- name: Install Valkey
shell: bash
run: |
cd ~/valkey
if command -v sudo &> /dev/null
then
echo "sudo command exists"
sudo make install
else
echo "sudo command does not exist"
make install
fi
echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile
cd ~/valkey
if command -v sudo &> /dev/null
then
echo "sudo command exists"
sudo make install
else
echo "sudo command does not exist"
make install
fi
echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile
- name: Verify Valkey installation and symlinks
if: ${{ !contains(inputs.engine-version, '-rc') }}
shell: bash
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.
EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"`
INSTALLED_VER=$(redis-server -v)
if [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then
echo "Wrong version has been installed. Expected: $EXPECTED_VERSION, Installed: $INSTALLED_VER"
exit 1
else
echo "Successfully installed the server: $INSTALLED_VER"
fi
# 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.
EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"`
INSTALLED_VER=$(redis-server -v)
if [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then
echo "Wrong version has been installed. Expected: $EXPECTED_VERSION, Installed: $INSTALLED_VER"
exit 1
else
echo "Successfully installed the server: $INSTALLED_VER"
fi

0 comments on commit 5582c5c

Please sign in to comment.