Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <[email protected]>
  • Loading branch information
wcchang1115 committed May 20, 2024
1 parent d3f6467 commit 242c503
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions .github/workflows/recce-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ env:
# dbt env variables used in your dbt profiles.yml
DBT_PROFILES_DIR: ./
DBT_GOOGLE_PROJECT: ${{ vars.DBT_GOOGLE_PROJECT }}
DBT_GOOGLE_DATASET: ${{ vars.DBT_GOOGLE_DATASET }}
DBT_GOOGLE_DEV_DATASET: ${{ vars.DBT_GOOGLE_DEV_DATASET }}
DBT_GOOGLE_KEYFILE: /tmp/google/google-service-account.json
KEYFILE_CONTENTS: ${{ secrets.KEYFILE_CONTENTS }}

Expand All @@ -20,8 +18,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -32,13 +28,10 @@ jobs:
run: |
pipx install poetry==1.7.1
poetry install
source $(poetry env info --path)/bin/activate
which dbt
poetry run which dbt
- name: Install Recce
run: |
source $(poetry env info --path)/bin/activate
pip install recce-nightly
run: poetry run pip install recce-nightly

- name: Add packages.yml file
run: |
Expand All @@ -51,30 +44,24 @@ jobs:
- name: Prepare dbt Base environment
run: |
source $(poetry env info --path)/bin/activate
git checkout ${{ github.event.pull_request.base.sha }}
dbt deps
dbt seed --target ${{ env.DBT_BASE_TARGET }} --target-path target-base
dbt run --target ${{ env.DBT_BASE_TARGET }} --target-path target-base
dbt docs generate --target ${{ env.DBT_BASE_TARGET }} --target-path target-base
env:
DBT_BASE_TARGET: "playground"
run_id=$(gh run list --workflow "OSO Recce Staging CI" --repo DataRecce/oso --status success --limit 1 --json databaseId --jq '.[0].databaseId')
gh run download $run_id --repo DataRecce/oso
mv dbt-artifacts target-base
- name: Set PR Schema
run: echo "DBT_GOOGLE_DEV_DATASET=PR_${{ github.event.pull_request.number }}" >> $GITHUB_ENV

- name: Prepare dbt Current environment
run: |
source $(poetry env info --path)/bin/activate
git checkout ${{ github.event.pull_request.head.sha }}
dbt deps
dbt seed --target ${{ env.DBT_CURRENT_TARGET}}
dbt run --target ${{ env.DBT_CURRENT_TARGET}}
dbt build --target ${{ env.DBT_CURRENT_TARGET}}
dbt docs generate --target ${{ env.DBT_CURRENT_TARGET}}
env:
DBT_CURRENT_TARGET: "dev"

- name: Run Recce CI
run: |
source $(poetry env info --path)/bin/activate
recce run
run: poetry run recce run

- name: Archive Recce State File
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 242c503

Please sign in to comment.