Skip to content

Commit 8df9ca0

Browse files
authored
setup github actions for deploying the app (#1)
* setup github actions * set requirements.txt in makefile * fix * fix * fix * fix * list connections * fix localstack name * fix * try no interactive mode * fix dbt deps * pytest as dep * pytest as dep
1 parent 3545c14 commit 8df9ca0

File tree

3 files changed

+86
-1
lines changed

3 files changed

+86
-1
lines changed

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: LocalStack CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'README.md'
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
schedule:
13+
# “At 00:00 on Sunday.”
14+
- cron: "0 0 * * 0"
15+
workflow_dispatch:
16+
17+
jobs:
18+
deploy-snowflake:
19+
name: Deploy to Snowflake emulator
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install Snow CLI
31+
run: |
32+
pip install snowflake-cli==3.7.2
33+
snow --version
34+
snow connection add \
35+
--connection-name localstack \
36+
--user test \
37+
--password test \
38+
--account test \
39+
--role test \
40+
--warehouse test \
41+
--database test \
42+
--schema test \
43+
--port 4566 \
44+
--host snowflake.localhost.localstack.cloud \
45+
--no-interactive
46+
snow connection list
47+
48+
- name: Start LocalStack
49+
uses: LocalStack/[email protected]
50+
with:
51+
image-tag: 'latest'
52+
use-pro: 'true'
53+
configuration: LS_LOG=trace
54+
install-awslocal: 'true'
55+
env:
56+
IMAGE_NAME: localstack/snowflake:latest
57+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
58+
59+
- name: Install dependencies
60+
run: |
61+
make install
62+
63+
- name: Create Snowflake resources
64+
run: |
65+
make seed
66+
67+
- name: Create AWS resources
68+
run: |
69+
make aws
70+
make upload
71+
72+
- name: Run dbt models
73+
run: |
74+
make dbt
75+
76+
- name: Deploy Native App
77+
run: |
78+
make app
79+
80+
- name: Run tests
81+
run: |
82+
pip3 install pytest
83+
pytest tests/

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ install: ## Install dependencies
2222
@echo "Installing dependencies..."
2323
pip install virtualenv
2424
virtualenv env
25-
bash -c "source env/bin/activate && pip install -r requirements-dev.txt"
25+
bash -c "source env/bin/activate && pip install -r requirements.txt"
26+
bash -c "source env/bin/activate && dbt deps"
2627
@echo "Dependencies installed successfully."
2728

2829
seed: ## Create & Seed the database

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ dagster-aws
1212
dagster-dbt
1313
dagster-webserver
1414
snowflake-cli
15+
pytest

0 commit comments

Comments
 (0)