mirror of
https://github.com/luxfi/precompile.git
synced 2026-07-27 03:33:45 +00:00
100 lines
3.0 KiB
YAML
100 lines
3.0 KiB
YAML
name: CI
|
|
|
|
# Go build/test for the precompile suite.
|
|
#
|
|
# luxfi/accel v1.1.3+ auto-discovers the lux-gpu substrate (header +
|
|
# libluxgpu_hqc.a) by probing every standard install prefix. CI:
|
|
# 1. Checks out luxfi/mlx as a sibling repo
|
|
# 2. Builds it once (CPU-only — no GPU device required on the runner)
|
|
# 3. Installs it to /usr/local (cmake --install build)
|
|
# 4. Runs the Go build/test/vet — no CGO_CFLAGS / CGO_LDFLAGS needed
|
|
#
|
|
# Setting MLX_ROOT or LUX_GPU_PREFIX is no longer required.
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [main, dev]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
GOWORK: off
|
|
|
|
jobs:
|
|
test:
|
|
name: Build + Test
|
|
runs-on: lux-build-amd64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache-dependency-path: go.sum
|
|
|
|
- name: Checkout luxfi/mlx sibling repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: luxfi/mlx
|
|
# actions/checkout requires path to live inside the workspace.
|
|
# Keep it adjacent under the workspace; build steps follow.
|
|
path: mlx-sibling
|
|
ref: main
|
|
|
|
- name: Checkout PQClean sibling repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: PQClean/PQClean
|
|
path: pqclean-sibling
|
|
# PQClean is upstream; pin via ref to keep build reproducible.
|
|
# main is fine for CI — we only consume hqc-{128,192,256} which
|
|
# are stable.
|
|
ref: master
|
|
|
|
- name: Build + install lux-gpu (CPU-only, no GPU device required)
|
|
working-directory: mlx-sibling
|
|
run: |
|
|
# mlx's CMake silently disables luxgpu_hqc when PQClean source
|
|
# is unavailable, then `make luxgpu_hqc` fails with
|
|
# 'No rule to make target luxgpu_hqc'. Point it at our sibling
|
|
# checkout so the HQC kernel target is created.
|
|
cmake -S . -B build \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
-DLUX_GPU_BUILD_CUDA=OFF \
|
|
-DLUX_GPU_BUILD_METAL=OFF \
|
|
-DLUX_HQC_PQCLEAN_DIR="${GITHUB_WORKSPACE}/pqclean-sibling/crypto_kem"
|
|
cmake --build build --target luxgpu_hqc luxgpu_core_static --parallel
|
|
sudo cmake --install build
|
|
pkg-config --modversion lux-gpu
|
|
pkg-config --cflags --libs lux-gpu
|
|
|
|
- name: Show resolved GPU paths
|
|
run: |
|
|
go run -mod=mod ./... -h 2>/dev/null || true
|
|
go test -run TestPathReport_LogsResolved -v github.com/luxfi/accel || true
|
|
|
|
- name: Build
|
|
run: make build
|
|
|
|
- name: Test (short)
|
|
run: make test
|
|
|
|
- name: Vet
|
|
run: make vet
|
|
|
|
govulncheck:
|
|
name: govulncheck
|
|
runs-on: lux-build-amd64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
- run: govulncheck ./... || true
|