Skip to content

QVAC-21100: Switch to static C/C++ windows runtimes #586

QVAC-21100: Switch to static C/C++ windows runtimes

QVAC-21100: Switch to static C/C++ windows runtimes #586

name: On PR Trigger (Classification-ggml)
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- labeled
branches:
- main
- release-*
- feature-*
- tmp-*
paths:
- "packages/classification-ggml/**"
- ".github/workflows/*classification-ggml*.yml"
workflow_dispatch:
permissions:
contents: read
pull-requests: read
packages: read
id-token: write
env:
PKG_DIR: packages/classification-ggml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
label-gate:
name: Authorise (label-gate)
runs-on: ubuntu-latest
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
permissions:
contents: read
pull-requests: write
outputs:
allowed: ${{ steps.auth.outputs.allowed }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
- name: Authorize
id: auth
uses: ./.github/actions/authorize-pr
with:
github-token: ${{ github.token }}
changes:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
outputs:
pkg: ${{ steps.filter.outputs.pkg }}
steps:
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # 4.0.1
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
pkg:
- "packages/classification-ggml/**"
- ".github/workflows/*classification-ggml*.yml"
sanity-checks:
needs: [authorize, changes, label-gate]
if: always() && !cancelled() && needs.label-gate.outputs.authorised == 'true' && ((needs.changes.outputs.pkg == 'true' && needs.authorize.outputs.allowed == 'true') || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
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/classification-ggml
ts-checks:
needs: [authorize, changes, sanity-checks]
if: always() && !cancelled() && needs.authorize.outputs.allowed == 'true' && (needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.PKG_DIR }}
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
run: npm install --ignore-scripts
- name: Type declaration check
run: npm run test:dts
cpp-lint:
needs: [authorize, changes, sanity-checks, label-gate]
if: |
always() &&
!cancelled() &&
needs.label-gate.outputs.authorised == 'true' &&
needs.authorize.outputs.allowed == 'true' &&
(needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/cpp-lint.yaml
secrets: inherit
with:
sha: ${{ github.event.pull_request.base.sha || github.event.before || 'HEAD~1' }}
pr_head_sha: ${{ github.event.pull_request.head.sha || github.sha }}
workdir: packages/classification-ggml
cpp-tests:
needs: [authorize, changes, sanity-checks, label-gate]
if: |
always() &&
!cancelled() &&
needs.label-gate.outputs.authorised == 'true' &&
needs.authorize.outputs.allowed == 'true' &&
(needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/cpp-tests-classification.yml
secrets: inherit
with:
workdir: packages/classification-ggml
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
prebuild:
permissions:
contents: write
packages: write
pull-requests: write
id-token: write
needs: [authorize, changes, sanity-checks, label-gate]
if: |
always() &&
!cancelled() &&
needs.label-gate.outputs.authorised == 'true' &&
needs.authorize.outputs.allowed == 'true' &&
(needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/prebuilds-classification-ggml.yml
secrets: inherit
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
run-integration-tests:
needs: [authorize, changes, sanity-checks, prebuild, label-gate]
if: |
always() &&
!cancelled() &&
needs.label-gate.outputs.authorised == 'true' &&
needs.authorize.outputs.allowed == 'true' &&
(needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
permissions:
contents: read
packages: read
id-token: write
uses: ./.github/workflows/integration-test-classification-ggml.yml
secrets: inherit
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
run-mobile-integration-tests:
permissions:
contents: read
packages: read
pull-requests: write # Allow commenting on PRs
id-token: write
needs: [authorize, changes, sanity-checks, prebuild, label-gate]
if: |
always() &&
!cancelled() &&
needs.label-gate.outputs.authorised == 'true' &&
needs.authorize.outputs.allowed == 'true' &&
(needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/integration-mobile-test-classification-ggml.yml
secrets: inherit
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
merge-guard:
needs:
[
authorize,
changes,
sanity-checks,
ts-checks,
cpp-lint,
cpp-tests,
prebuild,
run-integration-tests,
run-mobile-integration-tests,
]
if: always() && !cancelled() && (needs.changes.outputs.pkg == 'true' || github.event_name == 'workflow_dispatch')
uses: ./.github/workflows/public-pr.yml
with:
sanity-checks-status: ${{ needs.sanity-checks.result == 'success' && needs.ts-checks.result == 'success' && needs.cpp-lint.result == 'success' && needs.cpp-tests.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') }}