-
Notifications
You must be signed in to change notification settings - Fork 6
178 lines (170 loc) · 5.8 KB
/
test.yml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Test Meltano Pipelines
on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
airflow_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: data/
environment: test
env:
MELTANO_ENVIRONMENT: cicd
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
CI_BRANCH: 'b${{ github.SHA }}'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Airflow
- run: meltano install utility airflow
- run: meltano test airflow
sqlfluff_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: data/
environment: test
env:
MELTANO_ENVIRONMENT: cicd
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
CI_BRANCH: 'b${{ github.SHA }}'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Add SSH key for accessing private dbt package repo
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
# Run Test
- run: meltano install utilities sqlfluff dbt-snowflake
- run: meltano run dbt-snowflake:deps
- run: meltano invoke sqlfluff lint
# - run: meltano invoke sqlfluff lint $(python sqlfluff_file_changes.py)
dbt_seed:
runs-on: ubuntu-latest
defaults:
run:
working-directory: data/
environment: test
env:
MELTANO_ENVIRONMENT: cicd
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
CI_BRANCH: 'b${{ github.SHA }}'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Add SSH key for accessing private dbt package repo
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
# Run Test
- run: meltano install utility dbt-snowflake
- run: meltano run dbt-snowflake:run_dbt_artifacts dbt-snowflake:seed
el_tests:
runs-on: ubuntu-latest
needs: [airflow_tests, sqlfluff_tests, dbt_seed]
defaults:
run:
working-directory: data/
environment: test
strategy:
matrix:
extract-source: ['meltanohub_el', 'spreadsheets_anywhere_el', 'github_search_el', 'github_meltano_el', 'gitlab_el', 'slack_el', 'google_analytics_el', 'snowplow_el', 'cloudwatch_el', 'dynanmodb_el']
env:
MELTANO_ENVIRONMENT: cicd
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
CI_BRANCH: 'b${{ github.SHA }}'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "DEFAULT_START_DATE_1D=$(date +'%Y-%m-%d' -d '1 day ago')" >> $GITHUB_ENV
- run: echo "DEFAULT_START_DATE_24HR=$(date +'%Y-%m-%d %H:%M:%S' -d '24 hours ago')" >> $GITHUB_ENV
- run: echo "DEFAULT_START_DATE_4HR=$(date +'%Y-%m-%d %H:%M:%S' -d '4 hours ago')" >> $GITHUB_ENV
- run: echo "DEFAULT_START_DATE_2HR=$(date +'%Y-%m-%d %H:%M:%S' -d '2 hours ago')" >> $GITHUB_ENV
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Add SSH key for accessing private dbt package repo
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
# Install Plugins
- run: meltano install --schedule=${{ matrix.extract-source }}
# Run Test
- run: meltano run ${{ matrix.extract-source }}
transform_tests:
runs-on: ubuntu-latest
needs: [el_tests]
defaults:
run:
working-directory: data/
environment: test
env:
MELTANO_ENVIRONMENT: cicd
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
CI_BRANCH: 'b${{ github.SHA }}'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Add SSH key for accessing private dbt package repo
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
# Run Test
- run: meltano install utility dbt-snowflake
- run: meltano run dbt-snowflake:run dbt-snowflake:test
reverse_el_tests:
runs-on: ubuntu-latest
needs: [transform_tests]
defaults:
run:
working-directory: data/
environment: test
env:
MELTANO_ENVIRONMENT: cicd
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
CI_BRANCH: 'b${{ github.SHA }}'
TAP_SNOWFLAKE_METRICS_TABLES: '["b${{ github.SHA }}_MELTANO_HUB.FACT_VARIANT_HUB_METRICS"]'
TAP_SNOWFLAKE_AUDIT_TABLES: '["b${{ github.SHA }}_MELTANO_HUB.HUB_METRICS_AUDIT"]'
TAP_SNOWFLAKE_SINGER_ACTIVITY: '["b${{ github.SHA }}_MELTANO_HUB.SINGER_ACTIVITY_NOTIFICATIONS"]'
TAP_SNOWFLAKE_MELTANO_ACTIVITY: '["b${{ github.SHA }}_MELTANO_HUB.MELTANO_ACTIVITY_NOTIFICATIONS"]'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Add SSH key for accessing private dbt package repo
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
# Install Plugins
- run: meltano install --schedule=hub_metrics_publish
# Run Test
- run: meltano run hub_metrics_publish