mirror of
https://github.com/hanzoai/php-sdk.git
synced 2026-10-30 18:24:25 +00:00
The quickstart used KeysApi and the untyped-response example ModelsApi, and the auth notes named DefaultApi and CommandsApi. None exists in src/Api or in the v8.5.156 tag Packagist serves, so `composer require hanzoai/hanzoai` followed by the quickstart died with "Class Hanzo\Cloud\Api\KeysApi not found". They now use AccountApi::getAccountKeys (GET /v1/account/keys, what examples/hello.php calls) and AiApi::getModelsRequest, both present at v8.5.156 and here. scripts/readme refuses any *Api class the README names that src/Api lacks; it runs in the hanzo.yml gate. It exits 1 on the old README and 0 now. Co-authored-by: Hanzo Dev <[email protected]>
44 lines
1.9 KiB
YAML
44 lines
1.9 KiB
YAML
# Hanzo CI — the ONE way this repo is gated, read by hanzoai/ci.
|
|
#
|
|
# No `images:` and no `deploy:`: this is a client library. A consumer installs it
|
|
# from Packagist at a tag, so what CI owes is a gate, not an artifact.
|
|
|
|
test:
|
|
- name: build
|
|
# `php -l` is the compiler this language has: it parses every file and
|
|
# refuses a redeclaration, which is exactly how the four name collisions in
|
|
# the document announce themselves. `--strict-psr` is the other half — it
|
|
# fails when a class does not sit in the file PSR-4 says it does, which no
|
|
# parse can see and which would only surface as "class not found" in a
|
|
# consumer's application.
|
|
run: |
|
|
set -e
|
|
composer install --no-interaction --no-progress
|
|
composer validate --strict --no-check-lock
|
|
find src examples -name '*.php' -print0 | xargs -0 -n1 -P4 php -l > /dev/null
|
|
composer dump-autoload --optimize --strict-psr
|
|
|
|
- name: readme
|
|
# The API classes the README names are ones src/Api has.
|
|
run: ./scripts/readme
|
|
|
|
- name: examples
|
|
# The one flow that needs no credential, run for real against the API. It
|
|
# proves the whole path a consumer takes — autoload, Configuration, the
|
|
# request the client builds, a 200 back — which linting cannot.
|
|
run: php examples/models.php
|
|
|
|
# THE CLIENT LANE — this repo is a PROJECTION of one API document at one version.
|
|
#
|
|
# hanzoai/cloud's release sends `repository_dispatch: spec-update` carrying
|
|
# (version, sha, spec_sha256); hanzoai/ci fetches openapi.yaml AT THAT SHA,
|
|
# REFUSES if the bytes hash to anything else, runs `generate:`, writes
|
|
# `.spec-lock` beside the code, and — only after `test:` above has passed over
|
|
# exactly those bytes — commits.
|
|
#
|
|
# NO version: — Packagist reads a release from a git TAG, so this client has no
|
|
# version field for the lane to bump. Its projection still lands and is still
|
|
# gated; the tag waits for a human.
|
|
client:
|
|
generate: ./scripts/generate.sh
|