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 e1aa980
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/recce-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,29 @@ env:

jobs:
check-pull-request:
permissions:
contents: write
name: Check pull request by Recce CI
runs-on: ubuntu-latest
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
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/DataRecce/oso
sleep 600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -35,7 +53,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 +70,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 e1aa980

Please sign in to comment.