Skip to content

Commit

Permalink
Fix unbound environment variable (#18)
Browse files Browse the repository at this point in the history
- Remove connection test
- Fix unbound variable issue
  • Loading branch information
sfc-gh-jvasquezrojas authored Jun 26, 2024
1 parent 5d6c323 commit 3d2795e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ jobs:
shell: bash
run: |
snow --version
snow connection list
snow connection test
snow connection list
35 changes: 35 additions & 0 deletions .github/workflows/set-unboud-pipx-variable-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: set-unboud-pipx-variable-test
on: [push]

jobs:
set-unboud-pipx-variable-test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest

env:
SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_CONNECTIONS_MYCONNECTION_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
PIPX_BIN_DIR: null

name: Install Snowflake CLI in ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Snowflake CLI
uses: ./
id: setup_snowcli
with:
cli-version: '2.1.0'
default-config-file-path: '.github/workflows/tests-files/config.toml'

- name: Test connection
shell: bash
run: |
snow --version
snow connection list
22 changes: 13 additions & 9 deletions scripts/install-snowcli.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#!/bin/sh

set -euo pipefail
PIPX_PATH="snow_pipx_path"

# These commands ensure that each time `snow` command is executed the system will use
# the executable in the pipx installation folder and not in any other installation folder.
if [ -z "${PIPX_BIN_DIR}" ]; then
export PIPX_BIN_DIR="~/.local/bin/$PIPX_PATH"
else
export PIPX_BIN_DIR="$PIPX_BIN_DIR/$PIPX_PATH"
fi

mkdir -p "$PIPX_BIN_DIR"


if [ "$CLI_VERSION" == "latest" ]; then
pipx install snowflake-cli-labs
else
pipx install snowflake-cli-labs==$CLI_VERSION
fi

extension=""
if [[ $RUNNER_OS = "Windows" ]]; then
extension=".exe"
fi

# These commands ensure that each time `snow` command is executed the system will use
# the executable in the pipx installation folder and not in any other installation folder.
mkdir "$PIPX_BIN_DIR/snow_pipx_path"
cp "$PIPX_BIN_DIR/snow$extension" "$PIPX_BIN_DIR/snow_pipx_path"
echo "$PIPX_BIN_DIR/snow_pipx_path" >> $GITHUB_PATH
echo "$PIPX_BIN_DIR" >> $GITHUB_PATH

0 comments on commit 3d2795e

Please sign in to comment.