gitea/.gitea/workflows/pr-checks.yml
logikonline badc4e4be3
Some checks failed
Build and Release / Lint (push) Failing after 7s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Failing after 6s
Build and Release / Unit Tests (push) Failing after 2m43s
ci: Improve CI with proper test configuration
- Split into separate lint, unit-test, and integration-test jobs
- Add PostgreSQL service for integration tests
- Run unit tests on modules/... and services/... with SQLite tags
- Remove unnecessary version checks (let actions install tools)
- Fix Go version to 1.24 (matches go.mod)
- Build only depends on lint passing (tests run in parallel)
- Keep continue-on-error on integration tests (may fail in CI)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 05:53:14 -05:00

112 lines
2.4 KiB
YAML

name: PR Checks
on:
pull_request:
branches:
- main
- release/*
env:
GOPROXY: https://proxy.golang.org,direct
GOPRIVATE: git.marketally.com
GONOSUMDB: git.marketally.com
GO_VERSION: "1.24"
NODE_VERSION: "22"
jobs:
# Quick lint checks - must pass
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
run: npm install -g pnpm
- name: Install Go dependencies
run: go mod download
- name: Check Go formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not formatted. Please run 'gofmt -w .'"
gofmt -l .
exit 1
fi
- name: Go vet
run: go vet ./...
- name: Go linter
run: |
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2 run
- name: Check for build errors
run: go build -v ./...
# Unit tests
test-unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install dependencies
run: go mod download
- name: Run unit tests
run: |
go test -tags="sqlite sqlite_unlock_notify" -race \
./modules/... \
./services/...
env:
GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT: true
# Frontend checks
frontend:
name: Frontend Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
continue-on-error: true
- name: TypeScript check
run: pnpm run tsc
continue-on-error: true
- name: ESLint
run: pnpm run eslint
continue-on-error: true