terraform-provider-llmgw/ is a module of its own, built on terraform-plugin-framework, so the gateway does not carry its dependencies. llmgw_model is a model added at runtime: scaling, class, owner and adapters change in place, anything else replaces it; the definition is kept as written rather than as the catalog filled it in. llmgw_quota and llmgw_guard_attachment keep the scope as written beside the ID it resolved to, and import by that ID. Data sources llmgw_models and llmgw_nodes. The client lists every endpoint it calls and refuses any other; a test checks each, and every field it sends and reads, against docs/admin-api.openapi.json, so a change to the admin API that breaks the provider fails here. Acceptance tests run Terraform against an admin API in memory when TF_ACC is set. CI vets and tests the module. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
59 lines
1.9 KiB
YAML
59 lines
1.9 KiB
YAML
# Runs on a containerized act_runner (label: ubuntu-latest).
|
|
#
|
|
# The runner needs outbound access to the Docker registry for its job image and
|
|
# to github.com for the actions below. If GitHub is unreachable from the runner,
|
|
# replace the checkout step with a plain `git clone` and install Go by hand —
|
|
# see .gitea/workflows/README.md in maas-proxmox for that pattern.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
# Lets a queued or failed run be retried from the UI without a new commit.
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
# Track the toolchain in go.mod rather than pinning it twice.
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Check formatting
|
|
run: |
|
|
out=$(gofmt -l .)
|
|
if [ -n "$out" ]; then echo "gofmt needed on:"; echo "$out"; exit 1; fi
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Test with the race detector
|
|
run: go test -race ./...
|
|
|
|
- name: Build
|
|
run: go build ./...
|
|
|
|
# The Terraform provider is a module of its own, which ./... above does
|
|
# not reach. Its tests check its client against docs/admin-api.openapi.json,
|
|
# so a change to the admin API that breaks the provider fails here. The
|
|
# acceptance tests (TF_ACC=1) are left out: they need Terraform itself.
|
|
- name: Test the Terraform provider
|
|
working-directory: terraform-provider-llmgw
|
|
run: |
|
|
go vet ./...
|
|
go test ./...
|
|
|
|
# The NVML backend needs cgo and cannot run without a driver, but it must
|
|
# at least keep compiling: it is the only source of NVLink topology and a
|
|
# break would otherwise surface on a GPU node, far from here.
|
|
- name: Build the NVML backend
|
|
env:
|
|
CGO_ENABLED: "1"
|
|
run: go build -tags nvml ./...
|