From 07b493b91cd160ecf2d97261916ed1d4261321cb Mon Sep 17 00:00:00 2001 From: Sycun <165354365+Sycun@users.noreply.github.com> Date: Fri, 9 Oct 2026 10:58:12 +0800 Subject: [PATCH] ci: gate self-update and configuration changes on three platforms --- .github/workflows/self-update.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/self-update.yml diff --git a/.github/workflows/self-update.yml b/.github/workflows/self-update.yml new file mode 100644 index 00000000..582cb0eb --- /dev/null +++ b/.github/workflows/self-update.yml @@ -0,0 +1,33 @@ +name: Self-update +on: + push: + paths: ['internal/update/**', 'internal/workflow/**', 'internal/config/**', 'internal/handler/**', 'internal/mcp/**', 'cmd/server/**', 'web/static/js/**', 'web/static/css/style.css', 'web/templates/index.html', 'upgrade.sh', 'run.sh', 'go.mod', 'go.sum', '.gitignore', '.github/workflows/self-update.yml'] + pull_request: + paths: ['internal/update/**', 'internal/workflow/**', 'internal/config/**', 'internal/handler/**', 'internal/mcp/**', 'cmd/server/**', 'web/static/js/**', 'web/static/css/style.css', 'web/templates/index.html', 'upgrade.sh', 'run.sh', 'go.mod', 'go.sum', '.gitignore', '.github/workflows/self-update.yml'] +permissions: + contents: read +jobs: + update: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Keep source line endings consistent + run: git config --global core.autocrlf false + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - uses: actions/setup-node@v4 + with: + node-version: '22' + - run: go test -race ./internal/update ./internal/config ./internal/handler ./cmd/server ./internal/workflow + - run: go build ./... + - name: Frontend regression tests + shell: bash + run: node --test web/static/js/*.test.cjs + - name: Shell syntax + shell: bash + run: bash -n run.sh upgrade.sh