-
Notifications
You must be signed in to change notification settings - Fork 56
40 lines (37 loc) · 1.47 KB
/
test_cli_action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: "CLI Action testing"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
version:
name: "Check Snowflake CLI version"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Snowflake-Labs/snowflake-cli-action@v1
with:
cli-version: "latest"
default-config-file-path: "tests_integration/config/connection_configs.toml"
- name: Set up key (Ubuntu / MacOS)
env:
SNOWFLAKE_CONNECTIONS_INTEGRATION_PRIVATE_KEY: ${{ secrets.SNOWFLAKE_PRIVATE_KEY }}
run: |
PARENT_DIR=$(dirname "${{ github.workspace }}")
PRIVATE_KEY_PATH=$PARENT_DIR/.ssh/key.p8
echo "PARENT_DIR=$PARENT_DIR" >> $GITHUB_ENV
echo "PRIVATE_KEY_PATH=$PRIVATE_KEY_PATH" >> $GITHUB_ENV
mkdir $PARENT_DIR/.ssh
echo "${SNOWFLAKE_CONNECTIONS_INTEGRATION_PRIVATE_KEY}" > $PRIVATE_KEY_PATH
sudo chmod 600 $PRIVATE_KEY_PATH
- name: Test connection
env:
TERM: unknown
SNOWFLAKE_CONNECTIONS_INTEGRATION_AUTHENTICATOR: SNOWFLAKE_JWT
SNOWFLAKE_CONNECTIONS_INTEGRATION_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_CONNECTIONS_INTEGRATION_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_CONNECTIONS_INTEGRATION_PRIVATE_KEY_PATH: ${{ env.PRIVATE_KEY_PATH }}
run: snow connection test -c integration | grep Status