mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
Remove package.json, package-lock.json, .prettierrc.json and .prettierignore. CI no longer installs npm dependencies or runs the Prettier check; the WebUI syntax check now calls `node --check webui/app.js` directly. Docs and .gitignore are updated to match.
59 lines
1.3 KiB
YAML
59 lines
1.3 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"
|
|
- name: Check Go formatting
|
|
shell: bash
|
|
run: |
|
|
unformatted="$(gofmt -l .)"
|
|
if [ -n "$unformatted" ]; then
|
|
printf '%s\n' "$unformatted"
|
|
exit 1
|
|
fi
|
|
- name: Check WebUI syntax
|
|
run: node --check webui/app.js
|
|
- name: Check container entrypoint syntax
|
|
run: sh -n docker-entrypoint.sh
|