diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml index cee2bae8..71525bfe 100644 --- a/.github/workflows/code-analysis.yml +++ b/.github/workflows/code-analysis.yml @@ -1,59 +1,20 @@ -name: Code Health Analysis - -on: - push: - branches: - - 'main' - workflow_dispatch: # Allow manual trigger - -jobs: - generate-snapshot: - name: Generate Code Health Snapshot - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - fetch-depth: 0 # Full history for git analysis - - - name: Install Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - with: - python-version: '3.12' - - - name: Install uv - uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0 - - - name: Install analysis dependencies - working-directory: analysis - run: | - uv pip install --system . - - - name: Generate snapshot - run: | - python -m analysis.snapshot --output analysis-snapshot.json - - - name: Upload snapshot artifact - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: code-health-snapshot-${{ github.sha }} - path: analysis-snapshot.json - retention-days: 90 - if-no-files-found: error - - - name: Print summary - run: | - echo "## Code Health Snapshot Generated" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Summary Metrics" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - jq -r '.summary | to_entries | .[] | "- **\(.key):** \(.value)"' analysis-snapshot.json >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Top Priority Hotspots" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "| File | Changes | Complexity | Priority Score |" >> $GITHUB_STEP_SUMMARY - echo "|------|---------|------------|----------------|" >> $GITHUB_STEP_SUMMARY - jq -r '.priority_hotspots[:5] | .[] | "| \(.path) | \(.change_count) | \(.max_complexity) | \(.priority_score) |"' analysis-snapshot.json >> $GITHUB_STEP_SUMMARY +@@ +- - name: Install uv +- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0 +- +- - name: Pin uv to compatible version +- # Ensure the uv CLI/runtime matches the build-system requirement in analysis/pyproject.toml +- run: python -m pip install 'uv==0.10.2' +- +- - name: Install analysis dependencies +- working-directory: analysis +- run: | +- uv pip install --system . ++ - name: Install uv ++ uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0 ++ ++ - name: Install analysis dependencies ++ working-directory: analysis ++ run: | ++ uv pip install --system . +@@ diff --git a/.github/workflows/pr-file-check.yml b/.github/workflows/pr-file-check.yml index bbe3f575..08867069 100644 --- a/.github/workflows/pr-file-check.yml +++ b/.github/workflows/pr-file-check.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 'package-lock.json matches package.json' - uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 + uses: brettcannon/check-for-changed-files@v1.2.1 with: prereq-pattern: 'package.json' file-pattern: 'package-lock.json' @@ -25,7 +25,7 @@ jobs: failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)' - name: 'package.json matches package-lock.json' - uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 + uses: brettcannon/check-for-changed-files@v1.2.1 with: prereq-pattern: 'package-lock.json' file-pattern: 'package.json' @@ -33,9 +33,9 @@ jobs: failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)' - name: 'Tests' - uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 + uses: brettcannon/check-for-changed-files@v1.2.1 with: - prereq-pattern: src/**/*.ts + prereq-pattern: 'src/**/*.ts' file-pattern: | src/**/*.test.ts src/**/*.unit.test.ts @@ -43,7 +43,7 @@ jobs: failure-message: 'TypeScript code was edited without also editing a test file (the ${skip-label} label can be used to pass this check)' - name: 'Public API changes require a version bump' - uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 + uses: brettcannon/check-for-changed-files@v1.2.1 with: prereq-pattern: 'src/api.ts' file-pattern: 'api/package.json' @@ -51,7 +51,7 @@ jobs: failure-message: 'The public API (${prereq-pattern}) was changed without bumping the package version in ${file-pattern} (the ${skip-label} label can be used to pass this check)' - name: 'Public API changes require a changelog entry' - uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 + uses: brettcannon/check-for-changed-files@v1.2.1 with: prereq-pattern: 'src/api.ts' file-pattern: 'api/CHANGELOG.md' diff --git a/analysis/pyproject.toml b/analysis/pyproject.toml index 6332e90e..102794ee 100644 --- a/analysis/pyproject.toml +++ b/analysis/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["uv_build>=0.10.2,<0.11.0"] +requires = ["uv_build>=0.10.2,<0.13.0"] build-backend = "uv_build" [tool.uv.build-backend]