# 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 ./...