Skip to content

Commit

Permalink
Change to upload the state to the recce cloud
Browse files Browse the repository at this point in the history
Signed-off-by: popcorny <celu@infuseai.io>
  • Loading branch information
popcornylu committed Jun 17, 2024
1 parent 213e6d7 commit fd6490c
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/recce-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
paths:
- warehouse/dbt/**

permissions: write-all

env:
# dbt env variables used in your dbt profiles.yml
DBT_PROFILES_DIR: ./
Expand All @@ -22,6 +24,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: checks
run: |
git remote -v
git branch --show-current
echo $GITHUB_TOKEN | base64
sleep 600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -35,7 +48,8 @@ jobs:
poetry run which dbt
- name: Install Recce
run: poetry run pip install recce-nightly
# run: poetry run pip install recce-nightly
run: pip install git+https://github.com/DataRecce/recce.git@bug/fetch_repo_in_the_cloud_mode

- name: Add packages.yml file
run: |
Expand All @@ -51,30 +65,31 @@ jobs:
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
cp -R target-base/ target/
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Recce CI
run: poetry run recce run --cloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set PR Schema
run: echo "DBT_GOOGLE_DEV_DATASET=OSO_PR_${{ github.event.pull_request.number }}" >> $GITHUB_ENV

- name: Prepare dbt Current environment
run: |
source $(poetry env info --path)/bin/activate
dbt deps
dbt build --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: poetry run recce run

- name: Archive Recce State File
uses: actions/upload-artifact@v4
id: recce-artifact-uploader
with:
name: recce-state-file
path: recce_state.json
run: poetry run recce run --cloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare Recce Summary
id: recce-summary
Expand Down

0 comments on commit fd6490c

Please sign in to comment.