Files
Travis Cline 6c81282073 examples: Fix examples and complete linting upgrade (#1288)
* examples: update examples, clean up module declarations

- Fix and relax lint rules (for now)
- Clean up and fix module declarations
- Add .gitattributes to mark go.sum as binary

* ci: separate and enhance CI workflows

- Split example builds into dedicated workflow
- Add comprehensive test coverage reporting
- Improve CI structure with matrix testing
- Add race condition testing
- Add automated PR coverage comments

* test: improve test reliability and agent message handling

- Simplify MRKL agent test to use basic math calculation
- Update OpenAI functions agent to use ToolChatMessage
- Add proper environment checks for Zep integration tests

* agents: fix issue in tool call handling for openai function agent
2025-06-03 07:52:03 -07:00

48 lines
1.3 KiB
YAML

name: Build Examples
on:
push: {}
pull_request:
branches:
- main
permissions:
contents: read
jobs:
discover-examples:
name: Discover Examples
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
# Find all example directories and create a JSON array
examples=$(find ./examples -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | sort | jq -R -s -c 'split("\n")[:-1]')
echo "matrix={\"example\":$examples}" >> $GITHUB_OUTPUT
echo "Found examples: $examples"
build-example:
name: Build ${{ matrix.example }}
needs: discover-examples
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.discover-examples.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
check-latest: false
cache-dependency-path: |
go.sum
examples/${{ matrix.example }}/go.sum
- name: Build ${{ matrix.example }}
run: |
cd examples/${{ matrix.example }}
echo "Building ${{ matrix.example }}"
go mod tidy
go build -o /dev/null .