Files
llmgw/.gitea/workflows/ci.yml
T

67 lines
2.3 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 ./...
# llmgw-kb runs on people's own machines, Windows included, which no
# test here runs on: building it for each catches a Unix-only call.
- name: Build llmgw-kb for every system
run: |
for target in windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 linux/amd64 linux/arm64; do
CGO_ENABLED=0 GOOS="${target%/*}" GOARCH="${target#*/}" go build -o /dev/null ./cmd/llmgw-kb
done
# 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 ./...