fix(ci): restore green main (workflow callers, type errors, coverage, hardening) #41
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PR Validation for Foundry Unify | |
| # Comprehensive pull request validation using org-level workflow plus additional checks. | |
| # | |
| # This workflow calls the org-level PR validation workflow and adds supplementary | |
| # checks for dead code detection and documentation links. | |
| name: PR Validation | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| # Cancel in-progress runs for same PR | |
| concurrency: | |
| group: pr-validation-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| # ========================================================================== | |
| # Org-Level PR Validation (Core Checks) | |
| # ========================================================================== | |
| core-validation: | |
| name: Core Validation | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| uses: ByronWilliamsCPA/.github/.github/workflows/python-ci.yml@e8fc83c98c2971ad1ece71573d28171463e30c16 # main | |
| with: | |
| python-version: '3.12' | |
| coverage-threshold: 80 | |
| enable-dead-code-check: true | |
| # ========================================================================== | |
| # Additional Checks (Template-Specific) | |
| # ========================================================================== | |
| # Dead Code Detection with Vulture | |
| dead-code: | |
| name: Dead Code Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner | |
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Install UV | |
| uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| cache-local-path: ".uv-cache" | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Run vulture | |
| run: | | |
| echo "## Dead Code Report" >> $GITHUB_STEP_SUMMARY | |
| uv run vulture src/ --min-confidence 90 | tee vulture-report.txt || true | |
| if [ -s vulture-report.txt ]; then | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat vulture-report.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "::warning::Potential dead code detected. Review vulture report." | |
| else | |
| echo "✅ No dead code detected with 90% confidence." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # Documentation Link Check | |
| link-check: | |
| name: Documentation Links | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden the runner | |
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Check documentation links | |
| uses: lycheeverse/lychee-action@2ac9f030ccdea0033e2510a23a67da2a2da98492 # v1.10.0 | |
| with: | |
| args: >- | |
| --verbose | |
| --no-progress | |
| --accept 200,204,206,301,302,403,429 | |
| --exclude-mail | |
| --exclude '^https://github.com/.*/(issues|pulls|compare)/.*$' | |
| --exclude '^https://linear.app/.*$' | |
| './docs/**/*.md' | |
| './README.md' | |
| './CONTRIBUTING.md' | |
| fail: false | |
| jobSummary: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ========================================================================== | |
| # Validation Summary | |
| # ========================================================================== | |
| validate-dependencies: | |
| name: Dependency & Standards Validation | |
| runs-on: ubuntu-latest | |
| needs: [core-validation, dead-code, link-check] | |
| if: always() | |
| steps: | |
| - name: Harden the runner | |
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
| with: | |
| egress-policy: audit | |
| - name: Check validation results | |
| run: | | |
| echo "## Dependency & Standards Validation" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ needs.core-validation.result }}" == "success" ]; then | |
| echo "✅ Core Validation: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Core Validation: ${{ needs.core-validation.result }}" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.dead-code.result }}" == "success" ]; then | |
| echo "✅ Dead Code Check: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "⚠️ Dead Code Check: ${{ needs.dead-code.result }}" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.link-check.result }}" == "success" ]; then | |
| echo "✅ Link Check: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "⚠️ Link Check: ${{ needs.link-check.result }}" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # Fail if core validation failed | |
| if [ "${{ needs.core-validation.result }}" == "failure" ]; then | |
| echo "" | |
| echo "❌ Core validation checks failed. Please review and fix issues." >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "✅ All validation checks passed!" >> $GITHUB_STEP_SUMMARY |