-
Notifications
You must be signed in to change notification settings - Fork 8
SNOW-1449792: Adding pipeline to integrate modified apps into Snowflake #9
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
Draft
sfc-gh-osalazarlizano
wants to merge
17
commits into
main
Choose a base branch
from
osalazar/SNOW-1449792
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
86f3d9d
Add pipeline for CLI + NA integration tests
sfc-gh-osalazarlizano 42ac466
Update ci-integration.yml
sfc-gh-osalazarlizano 7f78296
adding fixes
sfc-gh-osalazarlizano 56ec669
Update setup.sh
sfc-gh-osalazarlizano 81dceaf
Update ci.sh
sfc-gh-osalazarlizano 545146a
Update ci-integration.yml
sfc-gh-osalazarlizano 07ad9ed
Adding set -e to all bash scripts for CI
sfc-gh-osalazarlizano a026ed6
Adding CONTRIBUTING.md file
sfc-gh-osalazarlizano 0554061
Update CONTRIBUTING.md
sfc-gh-osalazarlizano ab95f55
Update CONTRIBUTING.md
sfc-gh-osalazarlizano 0e4bab9
Update spcs-three-tier/ci.sh
sfc-gh-osalazarlizano d0b2909
Update spcs-three-tier/ci.sh
sfc-gh-osalazarlizano de409bb
Update data-mapping/ci.sh
sfc-gh-osalazarlizano 630c845
changing workflows triggers
sfc-gh-osalazarlizano 35dbeb4
Update CONTRIBUTING.md
sfc-gh-osalazarlizano 19688c0
Update CONTRIBUTING.md
sfc-gh-osalazarlizano 4601156
Merge branch 'main' into osalazar/SNOW-1449792
sfc-gh-cgorrie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Modified Apps' | ||
description: 'Gets the modified apps root folder' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Get changed files | ||
id: changed-files-step | ||
run: $GITHUB_ACTION_PATH/modified_files.sh | ||
shell: bash | ||
env: | ||
GITHUB_ACTION_PATH: ${{ github.action_path }} | ||
GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
GITHUB_EVENT_BEFORE: ${{ github.event.before }} | ||
GITHUB_EVENT_AFTER: ${{ github.event.after }} | ||
- name: Get changed apps | ||
uses: actions/github-script@v7 | ||
id: changed-apps-step | ||
env: | ||
CHANGED_FILES: ${{ steps.changed-files-step.outputs.changed_files }} | ||
with: | ||
script: | | ||
const { CHANGED_FILES } = process.env; | ||
const paths = new Set(CHANGED_FILES.split(" ") | ||
.map(x => x.substring(0, x.indexOf("/") + 1)) | ||
.filter(x => x.length > 0 && !x.startsWith('.'))); | ||
core.setOutput('changedApps', [...paths].join(',')); | ||
outputs: | ||
modified_apps: | ||
description: 'The modified apps folders.' | ||
value: ${{ steps.changed-apps-step.outputs.changedApps }} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then | ||
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT | ||
else | ||
echo "changed_files=$(git diff --name-only $GITHUB_EVENT_BEFORE $GITHUB_EVENT_AFTER | xargs)" >> $GITHUB_OUTPUT | ||
fi |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
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: 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 |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
snow sql -f 'prepare/references.sql' | ||
snow app run | ||
snow app teardown |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
default_connection_name = "default" | ||
|
||
[connections] | ||
[connections.default] | ||
account = "" | ||
user = "" | ||
password = "" | ||
role = "" | ||
warehouse = "" |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sh prepare_data.sh | ||
sfc-gh-osalazarlizano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
snow app run | ||
snow app teardown |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
snow sql -f 'prepare/provider.sql' | ||
snow app run | ||
snow app teardown |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bash setup.sh | ||
sfc-gh-cgorrie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sh deploy.sh | ||
sfc-gh-osalazarlizano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sh cleanup.sh | ||
sfc-gh-osalazarlizano marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.