Skip to content

Add GitHub PR preview deployments #268

Add GitHub PR preview deployments

Add GitHub PR preview deployments #268

Workflow file for this run

name: Agent CI
on:
pull_request:
paths:
- "agent/**"
- ".github/workflows/agent-ci.yml"
push:
branches:
- main
paths:
- "agent/**"
- ".github/workflows/agent-ci.yml"
permissions:
contents: read
concurrency:
group: agent-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: blacksmith-2vcpu-ubuntu-2404
defaults:
run:
working-directory: agent
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: agent/go.mod
cache-dependency-path: agent/go.sum
- name: Test
run: go test ./...
- name: Vet
run: go vet ./...
- name: Install staticcheck
run: GOBIN=$PWD/.bin go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Staticcheck
run: ./.bin/staticcheck ./...
build:
runs-on: blacksmith-2vcpu-ubuntu-2404
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
defaults:
run:
working-directory: agent
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: agent/go.mod
cache-dependency-path: agent/go.sum
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
mkdir -p dist
go build -o dist/agent-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/agent