orchard/.github/workflows/ci.yml

77 lines
2.0 KiB
YAML

name: CI
on:
merge_group:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.0
only-new-issues: true
test-linux:
name: Test (Linux)
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Check out Vetu
uses: actions/checkout@v6
with:
repository: openai/vetu
path: _vetu
- name: Build Vetu
working-directory: _vetu
run: |
go build -o "$RUNNER_TEMP/vetu" cmd/vetu/main.go
sudo setcap cap_net_raw,cap_net_admin+eip "$RUNNER_TEMP/vetu"
echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
- name: Install Cloud Hypervisor
run: |
curl --fail --location --retry 3 \
--output "$RUNNER_TEMP/cloud-hypervisor" \
https://github.com/cloud-hypervisor/cloud-hypervisor/releases/latest/download/cloud-hypervisor-static
chmod +x "$RUNNER_TEMP/cloud-hypervisor"
- name: Enable KVM access
run: sudo chmod 0666 /dev/kvm
- name: Pre-pull default Vetu image
run: vetu pull ghcr.io/cirruslabs/ubuntu-amd64:24.04
- name: Run tests
run: go test -timeout=20m -v -count=1 ./...
test-macos:
name: Test (macOS)
runs-on: macos-26
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Run unit tests
run: go list ./... | grep -v '/internal/tests' | xargs go test -timeout=20m -ldflags="-B gobuildid" -v -count=1