update link. (#46) #106
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: Python application | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Snowflake connection by putting secrets into config file | |
env: | |
SNOWCLI_CONFIG: ${{secrets.SNOWCLI_CONFIG}} | |
shell: bash | |
run: | | |
echo -e "$SNOWCLI_CONFIG" > config.toml | |
# Snowflake CLI requires the config.toml file to limit its file permissions to read and write for the file owner only | |
chown $USER config.toml | |
chmod 0600 config.toml | |
- name: Snowflake CLI installation | |
uses: Snowflake-Labs/snowflake-cli-action@v1 | |
with: | |
cli-version: "latest" | |
default-config-file-path: "config.toml" | |
- name: Fetch the latest update from Github | |
run: | | |
snow sql -q "ALTER GIT REPOSITORY SFLAB_DEMO_NB FETCH;" | |
- name: Test Notebook - My First Notebook Project | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_FIRST_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/My First Notebook Project/' MAIN_FILE = 'My First Notebook Project.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_FIRST_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_FIRST_NB();" | |
- name: Test Notebook - Visual Data Stories | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_VISUAL_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Visual Data Stories with Snowflake Notebooks/' MAIN_FILE = 'Visual Data Stories with Snowflake Notebooks.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_VISUAL_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_VISUAL_NB();" | |
- name: Test Notebook - Ingest Public JSON | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_PUBLIC_JSON_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Ingest Public JSON/' MAIN_FILE = 'Ingest Public JSON.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_PUBLIC_JSON_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_PUBLIC_JSON_NB();" | |
- name: Test Notebook - Load CSV from S3 | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_CSV_S3_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Load CSV from S3/' MAIN_FILE = 'Load CSV from S3.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_CSV_S3_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_CSV_S3_NB();" | |
- name: Test Notebook - Reference cells and variables | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_CELLREF_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Reference cells and variables/' MAIN_FILE = 'Reference cells and variables.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_CELLREF_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_CELLREF_NB();" | |
- name: Test Notebook - Working with Files | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_FILES_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Working with Files/' MAIN_FILE = 'Working with Files.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_FILES_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_FILES_NB();" | |
- name: Test Notebook - Navigating and Browsing Files | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_MULTIFILE_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Navigating and Browsing Files/' MAIN_FILE = 'Navigating and Browsing Files.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_MULTIFILE_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_MULTIFILE_NB();" | |
- name: Test Notebook - Access External Endpoints | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_EAI_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Access External Endpoints/' MAIN_FILE = 'Access External Endpoints.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_EAI_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE IMMEDIATE FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Access External Endpoints/setup.sql';" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_EAI_NB();" | |
- name: Test Notebook - Hyperparameter Tuning with sklearn | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_SKLEARN_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Hyperparameter Tuning with sklearn/' MAIN_FILE = 'Hyperparameter Tuning with sklearn.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_SKLEARN_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_SKLEARN_NB();" | |
- name: Test Notebook - Import from Stage | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_STAGE_IMPORT_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Import Package from Stage/' MAIN_FILE = 'Import Package from Stage.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_STAGE_IMPORT_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_STAGE_IMPORT_NB();" | |
# - name: Test Notebook - Working with Git | |
# run: | | |
# snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_GIT_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Working with Git/' MAIN_FILE = 'Working with Git.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
# snow sql -q "ALTER NOTEBOOK GH_ACTION_GIT_NB ADD LIVE VERSION FROM LAST;" | |
# snow sql -q "EXECUTE NOTEBOOK GH_ACTION_GIT_NB();" | |
- name: Test Notebook - Create Objects with Python API | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_PYTHONAPI_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Creating Snowflake Object using Python API/' MAIN_FILE = 'Creating Snowflake Object using Python API.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_PYTHONAPI_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_PYTHONAPI_NB();" | |
- name: Test Notebook - Cortex ML Function | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_CORTEX_MLFUNC_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Getting Started with Snowflake Cortex ML-Based Functions/' MAIN_FILE = 'Getting Started with Snowflake Cortex ML-Based Functions.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_CORTEX_MLFUNC_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_CORTEX_MLFUNC_NB();" | |
- name: Test Notebook - End-to-End Machine Learning with Snowpark ML (1) | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_SPML1_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/End-to-End Machine Learning with Snowpark ML/' MAIN_FILE = '1_sf_nb_snowpark_ml_data_ingest.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_SPML1_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_SPML1_NB();" | |
- name: Test Notebook - End-to-End Machine Learning with Snowpark ML (2) | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_SPML2_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/End-to-End Machine Learning with Snowpark ML/' MAIN_FILE = '2_sf_nb_snowpark_ml_feature_transformations.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_SPML2_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_SPML2_NB();" | |
- name: Test Notebook - End-to-End Machine Learning with Snowpark ML (3) | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_SPML3_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/End-to-End Machine Learning with Snowpark ML/' MAIN_FILE = '3_sf_nb_snowpark_ml_model_training_inference.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_SPML3_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_SPML3_NB();" | |
- name: Test Notebook - Intro to Snowpark pandas | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_PANDAS_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Intro to Snowpark pandas/' MAIN_FILE = 'Intro to Snowpark pandas.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_PANDAS_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_PANDAS_NB();" | |
- name: Test Notebook - Data Engineering Pipelines with Snowpark Python | |
run: | | |
snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_DE_SNOWPARK_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Data Engineering Pipelines with Snowpark Python/' MAIN_FILE = 'Data Engineering Pipelines with Snowpark Python.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
snow sql -q "ALTER NOTEBOOK GH_ACTION_DE_SNOWPARK_NB ADD LIVE VERSION FROM LAST;" | |
snow sql -q "EXECUTE NOTEBOOK GH_ACTION_DE_SNOWPARK_NB();" | |
# - name: Test Notebook - Create and Manage Snowflake Objects like a Pro | |
# run: | | |
# snow sql -q "CREATE OR REPLACE NOTEBOOK GH_ACTION_PRO_NB FROM '@"GH_ACTION"."PUBLIC"."SFLAB_DEMO_NB"/branches/main/Create and Manage Snowflake Objects like a Pro/' MAIN_FILE = 'Create and Manage Snowflake Objects like a Pro.ipynb' QUERY_WAREHOUSE = 'GH_ACTION_WH';" | |
# snow sql -q "ALTER NOTEBOOK GH_ACTION_PRO_NB ADD LIVE VERSION FROM LAST;" | |
# snow sql -q "EXECUTE NOTEBOOK GH_ACTION_PRO_NB();" |