用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/canonical/inference-snap-maker-sdk --skill github-workflows命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Build, install, and runtime-verify an inference snap including engine selection and prompt/API checks.
Run the full inference-snap workflow as a sequential chain of subagents — structure → github workflows → static checks → build & test — passing each stage's report as input to the next.
Perform static quality checks for an inference snap (snapcraft.yaml consistency, component completeness, model signature verification).
正在显示 SKILL.md
| name | github-workflows |
| description | Create GitHub Actions workflow files for inference snap repositories. |
| trigger | Keywords like "add github workflows", "create CI/CD workflows", "set up github actions", "add workflow files" |
| scope | user |
Create the .github/workflows/ directory with proven CI/CD workflow files for inference snap repositories. These workflows handle building, testing, CLA checking, and engine validation.
Triggered on PR labels for building and testing pull requests.
# This workflow is used to build and test pull requests when specific labels are applied.
# Supported labels: trigger-build, trigger-tests
name: PR Label
on:
pull_request:
types: [ labeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
actions: read
jobs:
build-test:
name: ${{ github.event.label.name }}
uses: canonical/inference-snaps-dev/.github/workflows/reuse-pr-build-test.yaml@v2
with:
trigger-label: ${{ github.event.label.name }}
pr-number: "${{ github.event.pull_request.number }}"
build-runner: |
[
["amd64", "large", "noble", "self-hosted"],
["arm64", "noble", "self-hosted"]
]
test-jobs-matrix: |
[
{
"job-queue": "maas-systemtests-amd64",
"provision-data": "distro: noble",
"select-engine": "cpu",
"test-chat-tps": true,
"test-image-prompt": true
},
{
"job-queue": "anbox-nvidia-amd64",
"provision-data": "distro: noble",
"install-nvidia-driver-version": 595,
"select-engine": "nvidia-gpu",
"test-chat-tps": true,
"expected-tps": 9.4,
"test-image-prompt": true
}
]
snap-name: {{SNAP_NAME}}
testflinger-client-id: ${{ vars.TESTFLINGER_CLIENT_ID }}
secrets:
store-credentials: ${{ secrets.STORE_LOGIN_PR }}
github-token: ${{ secrets.GITHUB_TOKEN }}
testflinger-secret-key: ${{ secrets.TESTFLINGER_SECRET_KEY }}
# This workflow is used to validate pull requests.
# It includes the Canonical CLA check and engine validation.
name: PR Checks
on: [pull_request]
permissions:
contents: read
pull-requests: read
jobs:
cla:
runs-on: ubuntu-slim
steps:
- name: Check if CLA signed
uses: canonical/has-signed-canonical-cla@v2
validate:
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
# Prevent usage of simulated merge commit of PR
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Checkout inference-snap-cli
uses: actions/checkout@v7
with:
repository: canonical/inference-snaps-cli
{{ }}
# This workflow is used to build and publish the snap to the store on every push to main.
name: CICD
on:
push:
branches:
- main
workflow_dispatch: # manual trigger
# Keep one CICD run active at a time so publish/test/promote happen in order
concurrency:
group: ${{ github.workflow }}
queue: max
jobs:
cicd:
if: github.repository == 'canonical/{{SNAP_REPOSITORY}}' # do not run on forks
uses: canonical/inference-snaps-dev/.github/workflows/reuse-cicd.yaml@v2
with:
build-runner: |
[
["amd64", "large", "noble", "self-hosted"],
["self-hosted", "arm64", "noble"]
]
store-track: latest
snap-name: {{SNAP_NAME}}
smoke-test-engine: cpu
.github/workflows/ directory in the target repository.snap-name in testflinger-tests.yaml to match the target snap namevalidate-engines.yaml, replace ref: {{ CLI_TAG }} with the SAME
inference-snaps-cli tag used by the cli part in snap/snapcraft.yamltest-image-prompt only for vision models; drop it (or set false) for
text-only models. Only set expected-tps when you have a real measured
baseline for that model+engine — do not copy another model's number.cpu, nvidia-gpu); keep unrelated example jobs commented out.<snap-name> with the actual snap name.validate-engines.yaml's inference-snaps-cli ref to the same version as
the cli part in snap/snapcraft.yaml; never leave the placeholder.test-image-prompt/expected-tps from the model's real capabilities and
measured baselines — do not carry over another model's values.