Repository navigation
fix(python): align local score rounding with the reference #39
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
| name: Scoring | |
| # Required pull-request checks for FindAny/ghfind: the public scoring module, | |
| # SDKs and workflow lint. They need no secrets, so they are safe for forks. The | |
| # full application suite (ci.yml) runs after merge and on every deploy commit. | |
| on: | |
| # No path filters: these are the required pull-request checks for main. | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: scoring-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| scoring: | |
| name: Scoring parity (TS / Go / Python) and boundary | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| # The scorer must never need GitHub access; keep credentials out entirely. | |
| GITHUB_TOKEN: "" | |
| GH_TOKEN: "" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23.x" | |
| cache-dependency-path: scoring/go.mod | |
| - name: Install scoring package dependencies only | |
| run: pnpm install --frozen-lockfile --filter @ghfind/scoring... | |
| - name: Boundary (pure TS, stdlib-only Go, no credentials) | |
| run: node scripts/check-scoring-boundary.mjs | |
| - name: TypeScript reference — typecheck and tests | |
| working-directory: scoring | |
| run: | | |
| pnpm run typecheck | |
| pnpm test | |
| - name: Go port — vet, gofmt and tests | |
| working-directory: scoring | |
| run: | | |
| go vet ./... | |
| test -z "$(gofmt -l .)" || { gofmt -l .; exit 1; } | |
| go test ./... | |
| - name: Python port — parity tests | |
| working-directory: packages/ghfind-py | |
| run: | | |
| python3 -m pip install --quiet pytest | |
| python3 -m pytest -q | |
| - name: Rating fixture is generated from the TypeScript reference | |
| working-directory: scoring | |
| run: | | |
| pnpm run fixtures:rating | |
| git diff --exit-code -- fixtures/rating-ladder.json | |
| sdk-js: | |
| name: JavaScript SDK | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| working-directory: packages/ghfind-js | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: npm ci | |
| - run: npm run typecheck | |
| - run: npm test | |
| - run: npm run build | |
| workflow-lint: | |
| name: Workflow lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: actionlint | |
| uses: docker://rhysd/actionlint:1.7.12 | |
| with: | |
| args: -color -shellcheck= -pyflakes= | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Repository protection policy (scripts/feed-github-protection.mjs) | |
| run: node --test scripts/feed-github-protection.test.mjs |