From 5582c5c9b73eff52126be0d394e97680e80b2132 Mon Sep 17 00:00:00 2001 From: Chloe Yip Date: Tue, 17 Sep 2024 11:25:18 -0700 Subject: [PATCH] revert action.yml Signed-off-by: Chloe Yip --- .github/workflows/install-valkey/action.yml | 65 ++++++++++----------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/.github/workflows/install-valkey/action.yml b/.github/workflows/install-valkey/action.yml index 84a43ab7cf..62fe0e23f9 100644 --- a/.github/workflows/install-valkey/action.yml +++ b/.github/workflows/install-valkey/action.yml @@ -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