Skip to content

build(repo): Remove testdata #655

build(repo): Remove testdata

build(repo): Remove testdata #655

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CGO_ENABLED: 1
GO_VERSION: "1.25.2"
permissions:
contents: read
pull-requests: read
jobs:
validate-title:
name: Validate PR Title
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: true
subjectPattern: ^([A-Z]).+$
types: |
build
ci
docs
feat
fix
perf
refactor
test
scopes: |
repo
release
cli
engine
pkg
docs
examples
tools
schemas
cluster
agent
auth
task
workflow
memory
llm
mcp
runtime
infra
worker
core
autoload
project
schema
monitoring
server
store
cache
config
logger
template
swagger
ref
schemagen
tplengine
version
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
# Skip pre-commit for release PRs to avoid formatting conflicts with generated files
if: ${{ !startsWith(github.head_ref, 'release/') }}
steps:
- uses: actions/checkout@v4
- name: Check workflow files
uses: docker://rhysd/actionlint:latest
env:
SHELLCHECK_OPTS: --exclude=SC2086,SC2129
with:
args: -color
- name: Set up Go with caching
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
install-tools: "true"
- name: Install Python
uses: actions/setup-python@v5
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
commitlint:
name: Validating commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: bunx commitlint --last --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: |
bunx commitlint \
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \
--to ${{ github.event.pull_request.head.sha }} \
--verbose
# Detect which components have changed to optimize build times
changes:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'Makefile'
- '.github/workflows/ci.yml'
- 'engine/**'
- 'cli/**'
- 'pkg/**'
- 'schemas/**'
frontend:
- 'docs/**'
- 'examples/**'
- 'package.json'
- 'bun.lock'
- 'turbo.json'
- 'tsconfig.json'
docs:
- 'docs/**'
- '*.md'
- 'README.md'
# Go backend testing with testcontainers
test:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.backend == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go with caching
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
install-tools: "true"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Setup git-cliff for release tests
uses: ./.github/actions/setup-git-cliff
- name: Run linting
run: |
echo "Running Go code quality checks..."
golangci-lint run --fix --allow-parallel-runners
continue-on-error: false
- name: Generate Swagger documentation
run: |
echo "Generating API documentation..."
make swagger
continue-on-error: false
- name: Validate Swagger documentation
run: |
echo "Validating API documentation..."
make swagger-validate
continue-on-error: false
- name: Run tests
run: |
echo "Running unit and integration tests..."
make test
continue-on-error: false
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-go-${{ env.GO_VERSION }}
path: |
coverage.out
test-results.xml
retention-days: 7