Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/compuite-agent-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Compute Agent CI

on:
push:
branches: [ main, master ]
paths:
- 'compute-agent/**'
- 'pkg/**'
- 'sdk/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/compute-agent-ci.yml'
pull_request:
branches: [ main, master ]
paths:
- 'compute-agent/**'
- 'pkg/**'
- 'sdk/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/compute-agent-ci.yml'

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: compute-agent/go.mod # Point to service go.mod
cache: true

- name: Run unit tests with race and coverage
run: |
cd compute-agent
make test-unit || go test ./... -race -coverprofile=coverage.txt

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: unit-coverage
path: compute-agent/coverage.txt
if-no-files-found: warn

e2e-tests:
name: End-to-End Tests
runs-on: ubuntu-latest
needs: [unit-tests]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: compute-agent/go.mod
cache: true

- name: Run end-to-end tests
run: |
cd compute-agent
make test-e2e

build-binaries:
name: Build Binaries
runs-on: ubuntu-latest
needs: [unit-tests]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: compute-agent/go.mod
cache: true

- name: Build agent and client
run: |
cd compute-agent
go build -v ./cmd/agent
go build -v ./examples/client

docker-build:
name: Docker Build
runs-on: ubuntu-latest
needs: [unit-tests]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build optimized runtime image
uses: docker/build-push-action@v6
with:
context: . # Root context (needed for pkg/)
file: ./compute-agent/Dockerfile
target: runtime
push: false
tags: persys/compute-agent:ci-runtime
cache-from: type=gha
cache-to: type=gha,mode=max
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "persys-operator"]
path = persys-operator
url = https://github.com/persys-dev/persys-operator.git
[submodule "compute-agent"]
path = compute-agent
url = https://github.com/persys-dev/compute-agent.git
[submodule "persysctl"]
path = persysctl
url = https://github.com/persys-dev/persysctl.git
1 change: 0 additions & 1 deletion compute-agent
Submodule compute-agent deleted from cbdbc9
4 changes: 4 additions & 0 deletions compute-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin/
ai/
persys_compute_agent_design_doc.pdf
FIXES_SUMMARY.md
Loading
Loading