-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (59 loc) · 1.72 KB
/
diff-quality.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
name: CI Linting
on:
pull_request:
branches:
- master
env:
DBT_DEFAULT_PROFILE_TARGET: stellar_dbt_public
DBT_TARGET: prod
DBT_DATASET: crypto_stellar
DBT_PROJECT: crypto-stellar
DBT_PROFILES_DIR: ${{ github.workspace }}
DBT_MAX_BYTES_BILLED: 1000000000000
DBT_JOB_TIMEOUT: 300
DBT_THREADS: 1
DBT_JOB_RETRIES: 1
jobs:
pre-commit:
runs-on: ubuntu-latest
if: >-
github.event.pull_request.merged == false &&
github.event.pull_request.state == 'open'
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- id: file_changes
uses: trilom/file-changes-action@v1.2.4
with:
output: " "
- uses: pre-commit/action@v3.0.0
env:
extra_args: --color=always --files ${{ steps.file_changes.outputs.files}}
SKIP: sqlfluff-lint,sqlfluff-fix, cleanup
diff-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements.txt
dbt deps
- name: Authenticate to GCP
uses: "google-github-actions/auth@v2"
with:
project_id: crypto-stellar
credentials_json: "${{ secrets.CREDS_PROD_HUBBLE }}"
- name: Checkout source branch and diff quality
run: |
git checkout ${{ github.head_ref }}
diff-quality --violations=sqlfluff --compare-branch=origin/master --fail-under=95