gitea/.gitea/workflows/pr-checks.yml
logikonline 9d7fab06d6
Some checks failed
Build and Release / Lint and Test (push) Successful in 2m35s
Build and Release / Build Binaries (arm64, darwin) (push) Failing after 2m4s
Build and Release / Build Binaries (amd64, linux) (push) Failing after 2m24s
Build and Release / Build Docker Image (push) Failing after 17s
Build and Release / Build Binaries (arm64, linux) (push) Failing after 1m14s
Build and Release / Build Binaries (amd64, darwin) (push) Failing after 6m59s
Build and Release / Build Binaries (amd64, windows) (push) Failing after 6m58s
Build and Release / Create Release (push) Has been skipped
ci: detect existing Go/Node.js/pnpm before setup
Skip setup actions when tools are already installed on the runner.
This prevents forcing specific versions when the correct versions
are already available.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:47:54 -05:00

167 lines
4.2 KiB
YAML

name: PR Checks
on:
pull_request:
branches:
- main
- release/*
env:
GOPROXY: https://proxy.golang.org,direct
GO_VERSION: "1.25"
NODE_VERSION: "22"
jobs:
# Quick checks for PRs
checks:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for existing Go
id: go-check
run: |
if command -v go &> /dev/null; then
GO_VER=$(go version | grep -oP 'go\d+\.\d+' | head -1)
echo "version=$GO_VER" >> $GITHUB_OUTPUT
echo "Found Go: $(go version)"
fi
- name: Setup Go
if: steps.go-check.outputs.version == ''
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Check for existing Node.js
id: node-check
run: |
if command -v node &> /dev/null; then
NODE_VER=$(node --version)
echo "version=$NODE_VER" >> $GITHUB_OUTPUT
echo "Found Node.js: $NODE_VER"
fi
- name: Setup Node.js
if: steps.node-check.outputs.version == ''
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Check for existing pnpm
id: pnpm-check
run: |
if command -v pnpm &> /dev/null; then
PNPM_VER=$(pnpm --version)
echo "version=$PNPM_VER" >> $GITHUB_OUTPUT
echo "Found pnpm: $PNPM_VER"
fi
- name: Install pnpm
if: steps.pnpm-check.outputs.version == ''
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: Check for build errors
run: go build -v ./...
# Unit tests
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for existing Go
id: go-check
run: |
if command -v go &> /dev/null; then
GO_VER=$(go version | grep -oP 'go\d+\.\d+' | head -1)
echo "version=$GO_VER" >> $GITHUB_OUTPUT
echo "Found Go: $(go version)"
fi
- name: Setup Go
if: steps.go-check.outputs.version == ''
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run unit tests
run: |
go test -v -race -coverprofile=coverage.out ./...
continue-on-error: true
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out
retention-days: 7
# Frontend checks
frontend:
name: Frontend Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for existing Node.js
id: node-check
run: |
if command -v node &> /dev/null; then
NODE_VER=$(node --version)
echo "version=$NODE_VER" >> $GITHUB_OUTPUT
echo "Found Node.js: $NODE_VER"
fi
- name: Setup Node.js
if: steps.node-check.outputs.version == ''
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Check for existing pnpm
id: pnpm-check
run: |
if command -v pnpm &> /dev/null; then
PNPM_VER=$(pnpm --version)
echo "version=$PNPM_VER" >> $GITHUB_OUTPUT
echo "Found pnpm: $PNPM_VER"
fi
- name: Install pnpm
if: steps.pnpm-check.outputs.version == ''
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