mirror of
https://github.com/tiennm99/awesome-ai-dev-tools.git
synced 2026-10-05 18:14:16 +00:00
The CI failure on the merge commit was the one-time bootstrap ordering problem: `go run . -build` ran before any data/metadata.json existed. The nightly updater has since committed one, so the tree builds — but that commit was pushed with GITHUB_TOKEN, which by design does not re-trigger workflows, so CI never re-ran and main's status stayed red. That exposes a standing gap rather than a one-off: every nightly refresh commits the exact data the build consumes, and none of those commits run CI. A refresh that broke the build would first be noticed by Cloudflare at deploy time. Run `go run . -build` in the update workflow between the fetch and the commit, so data that does not build is never committed. Add workflow_dispatch to CI so a bot-pushed commit can still be verified on demand.
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
# Lets a bot-pushed commit be verified on demand: GITHUB_TOKEN pushes do not
|
|
# trigger workflows, so the nightly refresh otherwise leaves main's CI status
|
|
# reflecting the last human push.
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- '**.go'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.github/workflows/ci.yml'
|
|
- 'data/agents.yml'
|
|
- 'templates/**'
|
|
- 'site/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 'stable'
|
|
cache: true
|
|
|
|
- run: go vet ./...
|
|
- run: go test ./...
|
|
- run: go build ./...
|
|
- run: go run . -check
|
|
# Runs exactly what Cloudflare Pages runs, so a build that would fail on
|
|
# deploy fails here instead. Needs no token — that is the point of the split.
|
|
- run: go run . -build
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 'stable'
|
|
cache: true
|
|
|
|
- uses: golangci/golangci-lint-action@v9
|
|
|
|
vulncheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 'stable'
|
|
cache: true
|
|
|
|
- uses: golang/govulncheck-action@v1
|