fix(stats): parseCacheUsage 识别 input_tokens_details.cached_tokens #143
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.22.x" | |
| cache: false | |
| - name: Check formatting | |
| run: | | |
| files="$(gofmt -l .)" | |
| if [ -n "$files" ]; then | |
| echo "$files" | |
| exit 1 | |
| fi | |
| - name: Test | |
| run: go test ./... | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Build | |
| run: | | |
| go build -trimpath \ | |
| -ldflags "-s -w -X github.com/6Kmfi6HP/opencode2api/internal/app.version=ci -X github.com/6Kmfi6HP/opencode2api/internal/app.commit=${GITHUB_SHA::12} -X github.com/6Kmfi6HP/opencode2api/internal/app.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ | |
| -o /tmp/opencode2api ./cmd/opencode2api |