Add GitHub PR preview deployments #268
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |