Skip to content

Log evals as JSON

Log evals as JSON #75

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
llama32-1b:
image: "maragudk/llama-3.2-1b-instruct-q4_k_m"
ports:
- 8090:8080
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -coverprofile=cover.out -shuffle on ./...
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
ANTHROPIC_KEY: ${{ secrets.ANTHROPIC_KEY }}
GOOGLE_KEY: ${{ secrets.GOOGLE_KEY }}
evaluate:
name: Evaluate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Get dependencies
run: go mod download
- name: Install evals
run: go install maragu.dev/evals
- name: Evaluate
run: go test -json -run TestEval ./... | evals >> $GITHUB_STEP_SUMMARY
- name: Read $GITHUB_STEP_SUMMARY file
id: getsummary
run: |
content=$(cat $GITHUB_STEP_SUMMARY)
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo "summary=$content" >> $GITHUB_OUTPUT
- name: Add evals comment to PR
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `${{ steps.getsummary.outputs.summary }}`
})
- uses: actions/upload-artifact@v4
with:
name: evals.db
path: evals.db
if-no-files-found: error
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest