Repository navigation
131 lines (116 loc) · 3.75 KB
/
Copy pathmain.yml
File metadata and controls
131 lines (116 loc) · 3.75 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Test samples
on:
push:
paths-ignore:
- '**.md'
branches:
- main
pull_request:
branches:
- main
schedule:
# nightly regression run against the newest snowflake-next image
- cron: '17 3 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
sample:
name: ${{ matrix.sample }}
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
sample:
- airflow-dbt-transformation
- citi-bike-data-app
- claims-service
- credit-card-fraud-detection-with-snowpark
- credit-scoring-with-snowpark
- fleet-telemetry
- glue-snowflake-integration
- lambda-snowpark-connector
- metering-api
- migrate-and-swap
- multi-container
- order-to-cash-cdc
- phi-guardrails
- predicting-customer-spend
- slim-ci-lab
- soda-data-quality-checks
- streamlit-snowpark-dynamic-filters
- tenantboard
defaults:
run:
working-directory: ${{ matrix.sample }}
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Terraform
if: matrix.sample == 'glue-snowflake-integration'
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Setup uv
if: hashFiles(format('{0}/uv.lock', matrix.sample)) != ''
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Setup Java
if: hashFiles(format('{0}/pom.xml', matrix.sample)) != ''
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Setup Go
if: hashFiles(format('{0}/go.mod', matrix.sample)) != ''
uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.sample }}/go.mod
cache-dependency-path: ${{ matrix.sample }}/go.sum
- name: Setup .NET
if: hashFiles(format('{0}/global.json', matrix.sample)) != ''
uses: actions/setup-dotnet@v4
with:
global-json-file: ${{ matrix.sample }}/global.json
- name: Install lstk and the Snowflake and AWS CLIs
run: |
npm install -g @localstack/lstk
pip install snowflake-cli awscli-local terraform-local
for name in localstack local; do
snow connection add --connection-name $name --user test --password test \
--account test --host snowflake.localhost.localstack.cloud --no-interactive
done
- name: Install sample dependencies
run: make install
- name: Start LocalStack for Snowflake
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
# samples whose `start` target runs the app name this target start-localstack
run: |
if grep -q '^start-localstack:' Makefile; then make start-localstack; else make start; fi
- name: Run tests
env:
# samples tested with Testcontainers start their own emulator
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
run: make test
- name: Show LocalStack logs
if: failure()
env:
# docker compose refuses to read a compose file that requires the token
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
run: make logs || true