-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from TasmanAnalytics/feature/ci
Feature/ci
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: ci check | ||
|
||
on: | ||
pull_request: | ||
|
||
# Automatically cancel any previous runs of this workflow | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci-checks: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./integration_tests | ||
env: | ||
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | ||
SNOWFLAKE_USER_CI: ${{ secrets.SNOWFLAKE_CI_USER }} | ||
SNOWFLAKE_PASSWORD_CI: ${{ secrets.SNOWFLAKE_CI_USER_PASSWORD }} | ||
SNOWFLAKE_DATABASE_CI: ${{ secrets.SNOWFLAKE_CI_DATABASE }} | ||
SNOWFLAKE_ROLE_CI: ${{ secrets.SNOWFLAKE_CI_ROLE }} | ||
SNOWFLAKE_WAREHOUSE_CI: ${{ secrets.SNOWFLAKE_CI_WAREHOUSE }} | ||
SNOWFLAKE_SCHEMA_CI: DBT_CI_${{github.event.number}}_${{ github.actor }} # Creates a unique schema for each PR | ||
steps: | ||
- name: Checkout branch | ||
id: checkout-branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Poetry | ||
id: install-poetry | ||
run: | | ||
pipx install poetry | ||
- name: setup-python | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: 'poetry' # Auto cache based on poetry.lock | ||
|
||
- name: Install python deps | ||
id: install-python-deps | ||
run: | | ||
poetry install | ||
- name: Install dbt deps | ||
id: install-dbt-deps | ||
run: | | ||
poetry run dbt deps | ||
- name: Check dbt compiles and CI Profiles work | ||
id: check-dbt-compiles-and-ci-profiles-work | ||
run: | | ||
poetry run dbt compile --target snowflake-ci | ||
poetry run dbt debug --target snowflake-ci | ||
- name: dbt build on Snowflake | ||
id: dbt-build-snowflake | ||
run: | | ||
potery run dbt build --full-refresh --target snowflake-ci |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
tasman_integration_tests: | ||
outputs: | ||
snowflake-ci: | ||
account: xt59823.eu-west-2.aws | ||
client_session_keep_alive: true | ||
database: {{ env_var('SNOWFLAKE_DATABASE_CI') }} | ||
user: {{ env_var('SNOWFLAKE_USER_CI') }} | ||
password: {{ env_var('SNOWFLAKE_PASSWORD_CI') }} | ||
role: {{ env_var('SNOWFLAKE_ROLE_CI') }} | ||
schema: {{ env_var('SNOWFLAKE_SCHEMA_CI') }} | ||
warehouse: {{ env_var('SNOWFLAKE_WAREHOUSE_CI') }} | ||
threads: 12 | ||
type: snowflake |