Skip to content

chore: sync system instructions #48

chore: sync system instructions

chore: sync system instructions #48

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
permissions:
contents: write
env:
CGO_ENABLED: 1
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Cache Go modules
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test ./... -v -race -cover
- name: Verify documentation
run: make verify-docs
- name: Generate coverage
run: |
go test ./... -coverprofile=coverage.out
go tool cover -html coverage.out -o coverage.html
go tool cover -func=coverage.out | grep total
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.out
flags: unittests
name: codecov-umbrella
- name: Run coverage badge update
run: make update-coverage
- name: Run coverage table update
run: make update-coverage-table
- name: Upload coverage artifacts
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: |
coverage.out
coverage.html
coverage-badge.svg
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
args: --timeout=5m
build:
name: Build
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Build binary
run: make build
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: llm-tournament-linux
path: release/llm-tournament
screenshots:
name: Screenshots
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install chromium
- name: Generate screenshots
run: make screenshots
- name: Upload screenshot artifacts
uses: actions/upload-artifact@v6
with:
name: screenshots
path: |
assets/ui-*.png
commit-updates:
name: Commit Updates
runs-on: ubuntu-latest
needs: [test, lint, build, screenshots]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download screenshot artifacts
uses: actions/download-artifact@v6
with:
name: screenshots
path: assets
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Run coverage updates (badge and table)
run: |
make update-coverage
make update-coverage-table
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add coverage-badge.svg README.md assets/ui-*.png
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update coverage badge, table, and screenshots [skip ci]"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}