SNOW-1449792: Adding pipeline to integrate modified apps into Snowflake #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: native-app-examples-integration | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- labeled | |
- unlabeled | |
- synchronize | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
SNOWFLAKE_CONNECTIONS_DEFAULT_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} | |
SNOWFLAKE_CONNECTIONS_DEFAULT_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | |
SNOWFLAKE_CONNECTIONS_DEFAULT_USER: ${{ secrets.SNOWFLAKE_USER }} | |
SNOWFLAKE_CONNECTIONS_DEFAULT_ROLE: ${{ secrets.SNOWFLAKE_ROLE }} | |
SNOWFLAKE_CONNECTIONS_DEFAULT_WAREHOSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | |
- name: Set PIPX_BIN_DIR # This step will be removed after fixing a bug in snowflake-cli-action@v1 | |
run: echo "PIPX_BIN_DIR=$HOME/.local/bin" >> $GITHUB_ENV | |
- name: Get modified apps | |
id: modified-apps-step | |
uses: ./.github/actions/modified_apps | |
- name: Set up Snowflake CLI | |
uses: Snowflake-Labs/[email protected] | |
with: | |
cli-version: "latest" | |
default-config-file-path: "config.toml" | |
- name: Verify Snowflake Connection | |
run: | | |
snow --version | |
snow connection test | |
- name: Run Integration | |
run: | | |
set -e | |
modified_apps=${{ steps.modified-apps-step.outputs.modified_apps }} | |
IFS=',' read -ra modified_apps_array <<< "$modified_apps" | |
for app in "${modified_apps_array[@]}"; do | |
cd $app | |
if [ -f ci.sh ]; then | |
sh ci.sh | |
else | |
snow app run | |
snow app teardown | |
fi | |
cd .. | |
done |