[CI test · do not merge] all fabric consumers against DL fabric (registry #176) #525
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: On PR Trigger (OCR-GGML) | |
| on: | |
| pull_request_target: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - labeled | |
| branches: | |
| - main | |
| - release-* | |
| - feature-* | |
| - tmp-* | |
| paths: | |
| - "packages/ocr-ggml/**" | |
| - ".github/workflows/*ocr-ggml*.yml" | |
| workflow_dispatch: | |
| inputs: | |
| base_sha: | |
| description: >- | |
| Optional base SHA for cpp-lint (clang-format + clang-tidy) to diff | |
| against. When empty, the reusable cpp-lint workflow falls back to | |
| HEAD~1, so only files touched by the current commit get linted. | |
| Set this to a commit further back (e.g. 14e7c83e, the last commit | |
| before the clang-tidy buckets) to re-lint every C++ file we have | |
| touched since. | |
| type: string | |
| required: false | |
| default: "" | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| packages: read | |
| id-token: write | |
| env: | |
| PKG_DIR: packages/ocr-ggml | |
| jobs: | |
| label-gate: | |
| name: Authorise (label-gate) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| outputs: | |
| authorised: ${{ steps.gate.outputs.authorised }} | |
| steps: | |
| - name: Checkout (label-gate action only) | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| sparse-checkout: .github/actions/label-gate | |
| sparse-checkout-cone-mode: false | |
| - name: Run label-gate | |
| id: gate | |
| uses: ./.github/actions/label-gate | |
| with: | |
| github-token: ${{ secrets.PAT_TOKEN }} | |
| authorize: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| outputs: | |
| allowed: ${{ steps.auth.outputs.allowed }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| - name: Authorize | |
| id: auth | |
| uses: ./.github/actions/authorize-pr | |
| with: | |
| github-token: ${{ github.token }} | |
| verify-fabric-lockstep: | |
| if: needs.authorize.outputs.allowed == 'true' | |
| needs: [authorize] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| - name: Verify qvac-fabric versions are lockstep | |
| id: lockstep | |
| uses: ./.github/actions/verify-qvac-fabric-lockstep | |
| - name: Report verified version | |
| run: 'echo "Verified qvac-fabric version: ${{ steps.lockstep.outputs.version }}"' | |
| sanity-checks: | |
| if: needs.label-gate.outputs.authorised == 'true' && (needs.authorize.outputs.allowed == 'true' || github.event_name == 'workflow_dispatch') | |
| needs: | |
| - authorize | |
| - label-gate | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| PKG_DIR: packages/ocr-ggml | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Sanity checks | |
| uses: ./.github/actions/sanity-checks | |
| with: | |
| secret-token: ${{ secrets.GITHUB_TOKEN }} | |
| pat-token: ${{ secrets.PAT_TOKEN }} | |
| run-integration: ${{ needs.authorize.outputs.allowed == 'true' }} | |
| workdir: packages/ocr-ggml | |
| - name: Verify that yaml files are formatted | |
| id: yamlfmt | |
| uses: ./.github/actions/yamlfmt | |
| with: | |
| workdir: ${{ env.PKG_DIR }} | |
| continue-on-error: true | |
| cpp-lint: | |
| needs: [authorize, label-gate] | |
| if: needs.label-gate.outputs.authorised == 'true' && (needs.authorize.outputs.allowed == 'true' || github.event_name == 'workflow_dispatch') | |
| uses: ./.github/workflows/cpp-lint.yaml | |
| secrets: inherit | |
| with: | |
| sha: ${{ inputs.base_sha || github.event.pull_request.base.sha }} | |
| pr_head_sha: ${{ github.event.pull_request.head.sha }} | |
| workdir: packages/ocr-ggml | |
| ts-checks: | |
| needs: authorize | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 6.3.0 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| working-directory: packages/ocr-ggml | |
| run: npm install | |
| - name: Type declaration check | |
| working-directory: packages/ocr-ggml | |
| run: npm run test:dts | |
| prebuild: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| packages: write | |
| id-token: write | |
| needs: [authorize, label-gate] | |
| if: needs.label-gate.outputs.authorised == 'true' && (needs.authorize.outputs.allowed == 'true' || github.event_name == 'workflow_dispatch') | |
| uses: ./.github/workflows/prebuilds-ocr-ggml.yml | |
| secrets: inherit | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.ref || github.ref }} | |
| run-integration-tests: | |
| permissions: | |
| contents: read | |
| packages: read | |
| id-token: write | |
| needs: [authorize, prebuild, label-gate] | |
| if: needs.label-gate.outputs.authorised == 'true' && (needs.authorize.outputs.allowed == 'true' || github.event_name == 'workflow_dispatch') | |
| uses: ./.github/workflows/integration-test-ocr-ggml.yml | |
| secrets: inherit | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.ref || github.ref }} | |
| run-mobile-integration-tests: | |
| permissions: | |
| contents: read | |
| packages: read | |
| pull-requests: write | |
| id-token: write | |
| needs: [authorize, prebuild, label-gate] | |
| if: needs.label-gate.outputs.authorised == 'true' && (needs.authorize.outputs.allowed == 'true' || github.event_name == 'workflow_dispatch') | |
| uses: ./.github/workflows/integration-mobile-test-ocr-ggml.yml | |
| secrets: inherit | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.ref || github.ref }} | |
| combine-perf-reports: | |
| name: Combined Performance Report | |
| needs: [authorize, run-integration-tests, run-mobile-integration-tests] | |
| if: always() && needs.authorize.outputs.allowed == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repo (composites + perf scripts) | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | |
| with: | |
| sparse-checkout: | | |
| .github/actions/run-mobile-integration-tests | |
| scripts/perf-report | |
| sparse-checkout-cone-mode: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 6.3.0 | |
| with: | |
| node-version: lts/* | |
| - name: Combine performance reports | |
| uses: ./.github/actions/run-mobile-integration-tests/combine-perf-reports | |
| with: | |
| artifact-pattern: perf-report-ocr-*-${{ github.run_number }} | |
| report-title: 'OCR-GGML Performance Report (All Platforms)' | |
| # Drop desktop-only EasyOCR rows from the cross-platform table: the | |
| # full-suite and canvasSize tests are `skip: isMobile`, so their rows | |
| # can never have mobile data and only add empty columns here. They | |
| # still run on desktop and remain in the per-device desktop reports. | |
| exclude: 'full-suite|canvasSize lab_results' | |
| merge-guard: | |
| needs: [authorize, sanity-checks, prebuild, run-integration-tests, run-mobile-integration-tests, label-gate] | |
| # Always run so the PR still gets a status check even if label-gate is | |
| # skipped or fails; matches on-pr-tts-ggml.yml's pattern. | |
| if: always() | |
| uses: ./.github/workflows/public-pr.yml | |
| with: | |
| sanity-checks-status: ${{ needs.sanity-checks.result == 'success' }} | |
| build-status: ${{ needs.prebuild.result == 'success' }} | |
| integration-tests-status: ${{ (needs.run-integration-tests.result == 'success' || needs.run-integration-tests.result == 'skipped') && (needs.run-mobile-integration-tests.result == 'success' || needs.run-mobile-integration-tests.result == 'skipped') }} |