Skip to content

fixing test

fixing test #13

Workflow file for this run

name: ci
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install BPF and CGO dependencies
run: |
sudo apt-get update
sudo apt-get install -y libbpf-dev clang llvm
- name: gofmt
run: |
test -z "$(gofmt -l .)" || (echo "Run: gofmt -w on:" && gofmt -l . && exit 1)
- name: go vet
run: go vet ./...
- name: go test
run: go test ./... -short -count=1
- name: go generate (BPF / bpf2go)
run: go generate ./...
- name: go build (CGO, after generate)
run: |
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
CGO_ENABLED=1 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-mesh .
- name: cross-compile spectral-mesh (Windows, macOS, no CGO)
run: |
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS="-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}"
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
- name: go build spectral-edge (no CGO)
run: |
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
CGO_ENABLED=0 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-edge ./cmd/spectral-edge
test-linux-arm64:
runs-on: ubuntu-24.04-arm
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install BPF and CGO dependencies
run: |
sudo apt-get update
sudo apt-get install -y libbpf-dev clang llvm
- name: gofmt
run: |
test -z "$(gofmt -l .)" || (echo "Run: gofmt -w on:" && gofmt -l . && exit 1)
- name: go vet
run: go vet ./...
- name: go test
run: go test ./... -short -count=1
- name: go generate (BPF / bpf2go)
run: go generate ./...
- name: go build (CGO, after generate)
run: |
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
CGO_ENABLED=1 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-mesh .
- name: cross-compile spectral-mesh (Windows, macOS, no CGO)
run: |
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS="-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}"
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
- name: go build spectral-edge (no CGO)
run: |
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
CGO_ENABLED=0 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-edge ./cmd/spectral-edge