Skip to content

Move tests from scheduled queries / business queries to DBT #215

Move tests from scheduled queries / business queries to DBT

Move tests from scheduled queries / business queries to DBT #215

Workflow file for this run

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