Files
opencode2api/.github/workflows/checks.yml
T
Jason Xu df119c48e4 发布准备:合入 #36、#46、#48、#49、#50、#53;修复 #42、#44、#51、#52,并添加 GPL-3.0-or-later。
保留 reasoning 配置,新增免费模型可用性探测 / 手动恢复、首 SSE 事件超时,元数据改用官方地址。按维护者要求,最终文件树排除测试文件。

验证:本地 Go 回归、go vet / build、Prettier、JS / shell 语法及独立实例管理端验收通过。
2026-10-07 19:55:34 +08:00

61 lines
1.4 KiB
YAML

name: Checks
on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: checks-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Go ${{ matrix.go }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
go: ["1.24.x", stable]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: Vet
run: go vet ./...
- name: Build
run: go build -trimpath ./cmd/opencode2api
format:
name: Formatting and WebUI syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- run: npm ci --ignore-scripts
- name: Check Go formatting
shell: bash
run: |
unformatted="$(gofmt -l .)"
if [ -n "$unformatted" ]; then
printf '%s\n' "$unformatted"
exit 1
fi
- run: npm run format:check
- run: npm run check:web
- name: Check container entrypoint syntax
run: sh -n docker-entrypoint.sh