Skip to content

Commit

Permalink
add changed files to the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-osalazarlizano committed Jun 17, 2024
1 parent ef65f6e commit b83eb70
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
include:
- environment-file: mailorder/local_test_env.yml
- environment-file: local_test_env.yml
defaults:
run:
shell: bash -l {0}
Expand All @@ -32,11 +32,23 @@ jobs:
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: ${{ matrix.environment-file }}
- name: Get changes
id: changed-files
run: |
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
- name: List changed files
run: |
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$(dirname "${file}")"
done
- name: Install dependencies
run: |
python -m pip install pytest
- name: Run tests
working-directory: mailorder
run: |
pytest
15 changes: 15 additions & 0 deletions local_test_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is used to install packages for local testing
name: native-apps-examples-testing
channels:
- snowflake
dependencies:
- python=3.8
- pip
- pip:
- git+https://github.com/snowflakedb/snowflake-telemetry-python.git
- snowflake-native-apps-permission-stub
- snowflake-snowpark-python>=1.15.0
- snowflake-cli-labs>=2.0.0
- pytest
- streamlit>=1.26.0

1 change: 1 addition & 0 deletions mailorder/app/data/customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ create table if not exists

grant select on data.customers to application role app_csr;
grant select, insert, update, delete, truncate on data.customers to application role app_admin;

0 comments on commit b83eb70

Please sign in to comment.