Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codeowners and fix previous version installed on windows #30

Merged
merged 14 commits into from
Nov 28, 2024
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @sfc-gh-turbaszek @sfc-gh-jvasquezrojas @sfc-gh-astus
* @sfc-gh-turbaszek @sfc-gh-jvasquezrojas @sfc-gh-astus @sfc-gh-jmartinezramirez @sfc-gh-ecuberojimenez @sfc-gh-asalazarelizondo @sfc-gh-osalazarlizano @sfc-gh-ogarciabarquero @sfc-gh-gvenegascastro @sfc-gh-lcalderonachio
62 changes: 62 additions & 0 deletions .github/workflows/compare-versions-pip-and-pipx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: compare-versions-pip-and-pipx

on:
push:
branches:
- '*'
schedule:
- cron: "0 0 * * *"

jobs:
compare-versions-pip-and-pipx:
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 }}
sfc-gh-jvasquezrojas marked this conversation as resolved.
Show resolved Hide resolved

name: Install Snowflake CLI in ${{ matrix.os }} with pipx first and then with pip
steps:
- uses: actions/checkout@v4
sfc-gh-jvasquezrojas marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Snowflake CLI with pip
run: |
python -m pip install snowflake-cli

- name: Store snow version
shell: bash
run: |
snow --version >> version_output.txt
echo "snow_version_pip=$(cat version_output.txt)" >> $GITHUB_ENV

- name: Install Snowflake CLI with pipx
uses: ./
id: setup_snowcli
with:
default-config-file-path: '.github/workflows/tests-files/config.toml'

- name: Compare pipx and pip versions
shell: bash
run: |
snow_version_pipx=$(snow --version)
snow_version_pip="${{ env.snow_version_pip }}"

if [ "$snow_version_pipx" == "$snow_version_pip" ]; then
echo "The versions match: $snow_version_pipx"
else
echo "The versions do not match: pipx version is $snow_version_pipx, but expected version is $snow_version_pip"
exit 1
fi


Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
python-version: '3.10'

- name: Install Snowflake CLI with pip
run: python -m pip install snowflake-cli-labs
run: python -m pip install snowflake-cli

- name: Install Snowflake CLI with pipx
uses: ./
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
default-config-file-path: '.github/workflows/tests-files/config.toml'

- name: Install Snowflake CLI with pip
run: python -m pip install snowflake-cli-labs
run: python -m pip install snowflake-cli

- name: Test snow installation
shell: bash
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/list-snowflake-account-connections.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: connect-to-snowflake-account-test

on: [push]
on:
push:
branches:
- '*'
schedule:
- cron: "0 0 * * *"

jobs:
connect-to-snowflake-account-test:
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# action.yml
name: 'Install Snowflake CLI'
description: 'Download and install snowflake-cli-labs through pipx'
description: 'Download and install snowflake-cli through pipx'
branding:
icon: 'terminal'
color: 'blue'
Expand All @@ -18,7 +18,7 @@ inputs:
runs:
using: 'composite'
steps:
- name: Download snowflake-cli-labs ${{ inputs.cli_version }}
- name: Download snowflake-cli ${{ inputs.cli_version }}
shell: bash
run: bash $GITHUB_ACTION_PATH/scripts/install-snowcli.sh
env:
Expand Down
5 changes: 3 additions & 2 deletions scripts/install-snowcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -euo pipefail
PIPX_PATH="snow_pipx_path"
PYTHON_PATH=$(python -c "import sys; print(sys.executable)")

# 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.
Expand All @@ -12,9 +13,9 @@ mkdir -p "${PIPX_BIN_DIR}"


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


Expand Down