-
Notifications
You must be signed in to change notification settings - Fork 1
206 lines (178 loc) · 5.89 KB
/
melty.yaml
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Meltano Pipeline
on:
pull_request:
types: [opened, reopened, labeled, synchronize]
push:
branches: [main]
workflow_dispatch:
inputs:
environment:
description: Meltano Environment
required: true
default: prod
logConfig:
description: 'Logging configuration file'
required: true
default: 'logging/ci.yaml'
type: choice
options:
- logging/ci.yaml
- logging/dev.yaml
schedule:
- cron: '0 12 * * *' # Once a day around 6am CST (12am UTC)
env:
MELTANO_DATABASE_URI: ${{ secrets.MELTANO_DATABASE_URI }}
DUCKDB_PATH: ${{ secrets.DUCKDB_PATH }}
MELTANO_CLI_LOG_CONFIG: ${{ github.event.inputs.environment || 'logging/ci.yaml' }}
MELTANO_ENVIRONMENT: ${{ github.event.inputs.environment || 'prod' }}
MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }}
jobs:
meltano-run:
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Test/ELTP') }}
name: "Meltano Job: ${{ matrix.job }}"
runs-on: ubuntu-latest
container:
image: ghcr.io/meltano/meltano:latest-python3.11
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_IO_TOKEN }}
env:
TAP_GETPOCKET_CONSUMER_KEY: ${{ secrets.TAP_GETPOCKET_CONSUMER_KEY }}
TAP_GETPOCKET_ACCESS_TOKEN: ${{ secrets.TAP_GETPOCKET_ACCESS_TOKEN }}
TAP_GITHUB_AUTH_TOKEN: ${{ secrets.TAP_GITHUB_AUTH_TOKEN }}
TAP_READTHEDOCS_TOKEN: ${{ secrets.TAP_READTHEDOCS_TOKEN }}
TAP_STACKEXCHANGE_KEY: ${{ secrets.TAP_STACKEXCHANGE_KEY }}
TARGET_DUCKDB_PATH: ${{ secrets.TARGET_DUCKDB_PATH }}
strategy:
matrix:
include:
- job: "pocket-to-duckdb"
schedule: "daily_pocket"
- job: "stackoverflow-to-duckdb"
schedule: "daily_stackoverflow"
- job: "rtd-to-duckdb"
schedule: "daily_readthedocs"
- job: "gh-to-duckdb"
schedule: "daily_github"
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Check Meltano
run: |
meltano --version
- name: Install Plugins
run: |
meltano install --schedule ${{ matrix.schedule }}
- name: Run
env:
MELTANO_FF_STRICT_ENV_VAR_MODE: true
run: |
meltano run ${{ matrix.job }}
- name: Rename metrics log
run: |
mv logs/singer_metrics.log logs/singer_metrics_${{ matrix.job }}.log
- name: Upload metrics log
uses: actions/upload-artifact@v3.1.3
with:
name: singer-metrics
path: logs/singer_metrics_${{ matrix.job }}.log
lint:
name: Lint models
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ghcr.io/meltano/meltano:latest-python3.11
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_IO_TOKEN }}
env:
DUCKDB_PATH: ${{ secrets.DUCKDB_PATH }}
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Check Meltano
run: |
meltano --version
- name: Install SQLFluff
run: |
meltano install utility sqlfluff
- name: Lint
env:
MELTANO_CLI_LOG_LEVEL: info
run: |
meltano invoke sqlfluff:lint --format github-annotation-native -v transform/models evidence/sources
transform:
name: Data Transformation with dbt-duckdb
runs-on: ubuntu-latest
needs: [meltano-run, lint]
container:
image: ghcr.io/meltano/meltano:latest-python3.11
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_IO_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Check Meltano
run: |
meltano --version
- name: Install dbt-duckdb
run: |
meltano install transformer dbt-duckdb
- name: Transform and Test
run: |
meltano run dbt-duckdb:build
build-evidence:
name: Build Evidence site locally
needs: [transform]
runs-on: ubuntu-latest
container:
image: ghcr.io/meltano/meltano:latest-python3.11
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_IO_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Check Meltano
run: |
meltano --version
- name: Install evidence
run: |
meltano install transform dbt-duckdb
meltano install utility evidence
- name: Build
run: |
meltano invoke evidence build --strict
- name: Upload Evidence build
uses: actions/upload-artifact@v3.1.3
with:
name: evidence-build
path: evidence/build
deploy-evidence:
name: Deploy Evidence site
needs: [build-evidence]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Set Git config
run: |
git config --global --add safe.directory /__w/meltano-dataops/meltano-dataops
- name: Download Evidence build
uses: actions/download-artifact@v3.0.2
with:
name: evidence-build
path: evidence/build
- name: Deploy
uses: amondnet/vercel-action@v25.1.1
with:
github-comment: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: ${{ github.event_name == 'pull_request' && '' || '--prod' }}