diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fd339c9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,83 @@ +name: LocalStack CI + +on: + push: + paths-ignore: + - 'README.md' + branches: + - main + pull_request: + branches: + - main + schedule: + # “At 00:00 on Sunday.” + - cron: "0 0 * * 0" + workflow_dispatch: + +jobs: + deploy-snowflake: + name: Deploy to Snowflake emulator + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Snow CLI + run: | + pip install snowflake-cli==3.7.2 + snow --version + snow connection add \ + --connection-name localstack \ + --user test \ + --password test \ + --account test \ + --role test \ + --warehouse test \ + --database test \ + --schema test \ + --port 4566 \ + --host snowflake.localhost.localstack.cloud \ + --no-interactive + snow connection list + + - name: Start LocalStack + uses: LocalStack/setup-localstack@v0.2.4 + with: + image-tag: 'latest' + use-pro: 'true' + configuration: LS_LOG=trace + install-awslocal: 'true' + env: + IMAGE_NAME: localstack/snowflake:latest + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} + + - name: Install dependencies + run: | + make install + + - name: Create Snowflake resources + run: | + make seed + + - name: Create AWS resources + run: | + make aws + make upload + + - name: Run dbt models + run: | + make dbt + + - name: Deploy Native App + run: | + make app + + - name: Run tests + run: | + pip3 install pytest + pytest tests/ diff --git a/Makefile b/Makefile index 8a125bf..49f55d6 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,8 @@ install: ## Install dependencies @echo "Installing dependencies..." pip install virtualenv virtualenv env - bash -c "source env/bin/activate && pip install -r requirements-dev.txt" + bash -c "source env/bin/activate && pip install -r requirements.txt" + bash -c "source env/bin/activate && dbt deps" @echo "Dependencies installed successfully." seed: ## Create & Seed the database diff --git a/requirements.txt b/requirements.txt index 0d5d619..ff7eb85 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,3 +12,4 @@ dagster-aws dagster-dbt dagster-webserver snowflake-cli +pytest