Skip to content

Commit a665f18

Browse files
authored
Add circle-ci and remove github action (#72)
* Add circle-ci and remove github action * Update profiles
1 parent 5492f8d commit a665f18

File tree

4 files changed

+109
-126
lines changed

4 files changed

+109
-126
lines changed

.circleci/config.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
version: 2.1
2+
3+
jobs:
4+
5+
integration-tests:
6+
docker:
7+
- image: cimg/python:3.9.9
8+
- image: cimg/postgres:14.0
9+
10+
resource_class: small
11+
12+
environment:
13+
DBT_PROFILES_DIR: ./integration_tests/ci
14+
DBT_PROJECT_DIR: ./integration_tests
15+
BIGQUERY_SERVICE_KEY_PATH: "/home/circleci/bigquery-service-key.json"
16+
17+
steps:
18+
- checkout
19+
- run:
20+
name: Install Python packages
21+
command: |
22+
python3 -m venv venv
23+
. venv/bin/activate
24+
pip install -U pip setuptools wheel
25+
pip install dbt-core dbt-postgres dbt-bigquery dbt-snowflake
26+
27+
- run:
28+
name: Install dbt dependencies
29+
command: |
30+
. venv/bin/activate
31+
dbt deps --project-dir $DBT_PROJECT_DIR
32+
33+
- run:
34+
name: "Run Tests - Postgres"
35+
environment:
36+
POSTGRES_HOST: localhost
37+
POSTGRES_TEST_USER: postgres
38+
POSTGRES_TEST_PASSWORD: ''
39+
POSTGRES_TEST_PORT: 5432
40+
POSTGRES_TEST_DATABASE: circle_test
41+
command: |
42+
. venv/bin/activate
43+
dbt build -t postgres --project-dir $DBT_PROJECT_DIR
44+
45+
- run:
46+
name: "Set up GCP credentials"
47+
command: |
48+
echo "Writing to $BIGQUERY_SERVICE_KEY_PATH"
49+
echo $BIGQUERY_SERVICE_KEY > $BIGQUERY_SERVICE_KEY_PATH
50+
FILESIZE=$(stat -c%s "$BIGQUERY_SERVICE_KEY_PATH")
51+
echo "Size of $BIGQUERY_SERVICE_KEY_PATH = $FILESIZE bytes."
52+
echo "BIGQUERY_TEST_DATABASE = $BIGQUERY_TEST_DATABASE"
53+
54+
- run:
55+
name: "Run Tests - BigQuery"
56+
command: |
57+
. venv/bin/activate
58+
dbt build -t bigquery --project-dir $DBT_PROJECT_DIR
59+
60+
- run:
61+
name: "Run Tests - Snowflake"
62+
command: |
63+
. venv/bin/activate
64+
dbt build -t snowflake --project-dir $DBT_PROJECT_DIR
65+
66+
- store_artifacts:
67+
path: ./logs
68+
69+
workflows:
70+
version: 2
71+
test-all:
72+
jobs:
73+
- integration-tests

.github/workflows/pr_to_main.yml

-88
This file was deleted.

integration_tests/ci/profiles.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
config:
2+
send_anonymous_usage_stats: False
3+
use_colors: True
4+
5+
integration_tests:
6+
outputs:
7+
postgres:
8+
type: postgres
9+
host: "{{ env_var('POSTGRES_HOST') }}"
10+
user: "{{ env_var('POSTGRES_TEST_USER') }}"
11+
pass: "{{ env_var('POSTGRES_TEST_PASSWORD') }}"
12+
port: "{{ env_var('POSTGRES_TEST_PORT') | as_number }}"
13+
dbname: "{{ env_var('POSTGRES_TEST_DATABASE') }}"
14+
schema: dbt_utils_integration_tests_postgres
15+
threads: 5
16+
17+
bigquery:
18+
type: bigquery
19+
method: service-account
20+
keyfile: "{{ env_var('BIGQUERY_SERVICE_KEY_PATH') }}"
21+
project: "{{ env_var('BIGQUERY_TEST_DATABASE') }}"
22+
schema: "{{ env_var('BIGQUERY_TEST_SCHEMA') }}"
23+
threads: 10
24+
25+
snowflake:
26+
type: snowflake
27+
account: "{{ env_var('SNOWFLAKE_ACCOUNT') }}"
28+
user: "{{ env_var('SNOWFLAKE_TEST_USER') }}"
29+
password: "{{ env_var('SNOWFLAKE_TEST_PASSWORD') }}"
30+
role: "{{ env_var('SNOWFLAKE_TEST_ROLE') }}"
31+
database: "{{ env_var('SNOWFLAKE_TEST_DATABASE') }}"
32+
warehouse: "{{ env_var('SNOWFLAKE_TEST_WAREHOUSE') }}"
33+
schema: "{{ env_var('SNOWFLAKE_TEST_SCHEMA') }}"
34+
threads: 10
35+
36+
target: postgres

profiles.yml

-38
This file was deleted.

0 commit comments

Comments
 (0)