Repository navigation
chore(deps): bump github.com/charmbracelet/x/ansi from 0.11.7 to 0.11… #720
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: Go CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Go | |
| uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 | |
| with: | |
| go-version: '1.25.13' | |
| - name: Tidy modules | |
| run: go mod tidy | |
| - name: Formatting (gofmt) | |
| run: | | |
| out="$(gofmt -l .)" | |
| if [ -n "$out" ]; then echo "Unformatted files:"; echo "$out"; exit 1; fi | |
| - name: Build | |
| run: go build ./... | |
| - name: Test | |
| run: go test -race ./... | |
| - name: Lint (golangci-lint if available, else go vet) | |
| run: | | |
| if go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest 2>/dev/null; then | |
| $(go env GOPATH)/bin/golangci-lint run ./... | |
| else | |
| go vet ./... | |
| fi | |
| - name: Govulncheck | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| "$(go env GOPATH)/bin/govulncheck" ./... | |
| # Nested modules are not part of root `go test ./...` / `go build ./...` (separate go.mod). | |
| - name: Nested Go modules (plugin/sdk, plugin/examples/echo) | |
| run: | | |
| set -euo pipefail | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| VULN="$(go env GOPATH)/bin/govulncheck" | |
| for dir in plugin/sdk plugin/examples/echo; do | |
| echo "::group::$dir" | |
| ( | |
| cd "$dir" | |
| go mod tidy | |
| out="$(gofmt -l .)" | |
| if [ -n "$out" ]; then echo "Unformatted in $dir:"; echo "$out"; exit 1; fi | |
| go build ./... | |
| go test -race ./... | |
| go vet ./... | |
| "$VULN" ./... | |
| ) | |
| echo "::endgroup::" | |
| done | |
| LINT="$(go env GOPATH)/bin/golangci-lint" | |
| if [ -x "$LINT" ]; then | |
| for dir in plugin/sdk plugin/examples/echo; do | |
| echo "::group::lint $dir" | |
| (cd "$dir" && "$LINT" run ./...) | |
| echo "::endgroup::" | |
| done | |
| fi | |
| database-smoke: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_USER: marchat | |
| POSTGRES_PASSWORD: marchat | |
| POSTGRES_DB: marchat_ci | |
| options: >- | |
| --health-cmd "pg_isready -U marchat -d marchat_ci" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| mysql: | |
| image: mysql:8.0 | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: marchat_ci | |
| MYSQL_USER: marchat | |
| MYSQL_PASSWORD: marchat | |
| options: >- | |
| --health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -proot" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Go | |
| uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 | |
| with: | |
| go-version: '1.25.13' | |
| - name: Tidy modules | |
| run: go mod tidy | |
| - name: Postgres and MySQL schema smoke | |
| env: | |
| MARCHAT_CI_POSTGRES_URL: postgres://marchat:marchat@127.0.0.1:5432/marchat_ci?sslmode=disable | |
| # Must use mysql: or mysql:// prefix so detectDriver() does not treat the DSN as a SQLite path. | |
| MARCHAT_CI_MYSQL_URL: mysql:marchat:marchat@tcp(127.0.0.1:3306)/marchat_ci | |
| run: go test -race ./server -run 'Test(Postgres|MySQL)InitDBAndSchemaSmoke' -count=1 -v |