Skip to content

Add presidential candidates and filter in intermediate models #9

Add presidential candidates and filter in intermediate models

Add presidential candidates and filter in intermediate models #9

Workflow file for this run

name: Recce CI
on:
pull_request:
branches:
- main
paths:
- "dbt/**"
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: 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