Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/recce_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Recce CI

on:
pull_request:
branches: [main]

jobs:
check-pull-request:
name: Check pull request by Recce CI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python, Poetry and Dependencies
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.12
poetry-version: 1.8.3

- name: Install dbt packages
run: |
poetry run dbt deps

- name: Prepare dbt Base environment
run: |
git checkout main
poetry run dbt seed -t prod
poetry run dbt build -t prod --target-path target-base
poetry run dbt docs generate -t prod --target-path target-base

- name: Prepare dbt Current environment
run: |
git checkout -
poetry run dbt clone --state target-base --full-refresh
poetry run dbt build -s state:modified+ --state target-base
poetry run dbt docs generate

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

- name: Upload Recce State File
uses: actions/upload-artifact@v4
id: duckdb-uploader
with:
name: duckdb
path: |
jaffle_shop.duckdb

- name: Prepare Recce Summary
id: recce-summary
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
RECCE_STATE_PASSWORD: ${{ vars.RECCE_STATE_PASSWORD}}
run: |
set -eo pipefail

poetry run recce summary --cloud > recce_summary.md

# Add next steps message
cat << EOF >> recce_summary.md

## Next Steps
To view detailed Recce results:
1. Checkout the PR branch: \`git checkout ${{ github.event.pull_request.head.ref }}\`
2. Launch the Recce server: \`recce server --review --cloud\`
3. Open http://localhost:8000 in your browser
EOF

# Truncate summary if it exceeds GitHub's comment size limit
if [[ $(wc -c < recce_summary.md) -ge 65535 ]]; then
truncate -s 65000 recce_summary.md
echo "
... (Summary truncated due to size limit)

For the full summary, please check the Job Summary page: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
" >> recce_summary.md
fi

- name: Comment on pull request
uses: thollander/actions-comment-pull-request@v2
with:
filePath: recce_summary.md
comment_tag: recce
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# dbt
.user.yml
target/
target-base/
dbt_packages/
logs/

Expand Down
8 changes: 8 additions & 0 deletions package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
packages:
- package: dbt-labs/audit_helper
version: 0.12.0
- package: data-mie/dbt_profiler
version: 0.8.3
- package: dbt-labs/dbt_utils
version: 1.3.0
sha1_hash: 28d7cfe7e3dc5b633c976b979449074a46d5e422
5 changes: 5 additions & 0 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages:
- package: dbt-labs/audit_helper
version: 0.12.0
- package: data-mie/dbt_profiler
version: 0.8.3
Loading