| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- name: pr-checks
- # Verificacion de PRs (#1546): compila y testea server y agente en cada
- # pull_request (forks incluidos, token read-only, sin publicar nada). Los
- # assets de go-latest siguen saliendo solo del push a main (go.yml); aqui
- # solo se verifica. Los PRs de first-time contributors quedan "awaiting
- # approval" hasta que un maintainer apruebe el run (Actions).
- on:
- pull_request:
- concurrency:
- group: pr-checks-${{ github.event.pull_request.number }}
- cancel-in-progress: true
- jobs:
- eslint:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- with:
- node-version: 24
- cache: npm
- cache-dependency-path: app/package-lock.json
- - name: ESLint (app)
- working-directory: app
- run: npm ci --no-audit --no-fund && npm run lint
- landing:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- with:
- node-version: 24
- cache: npm
- cache-dependency-path: web/package-lock.json
- - name: Install landing dependencies and Chromium
- working-directory: web
- run: npm ci --no-audit --no-fund && npx playwright install --with-deps chromium
- - name: Test prerendered languages under the production CSP
- working-directory: web
- run: npm run test:langs
- server:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- with:
- node-version: 24
- cache: npm
- cache-dependency-path: app/package-lock.json
- - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
- with:
- go-version: '1.26'
- cache-dependency-path: |
- server-go/go.sum
- agent/go.sum
- # npm run build = tsc -b && vite build: el type-check va dentro.
- - name: Build frontend
- working-directory: app
- run: npm ci --no-audit --no-fund && npm run build
- - name: Copia dist al embed del binario
- run: rm -rf server-go/internal/staticspa/dist && cp -r app/dist server-go/internal/staticspa/dist
- # Los agentes embebidos son go:embed del server: sin ellos no compila,
- # y TestOpenArmVariants los abre. Version dummy: los assets reales con
- # version los compila solo main (go.yml). Nombres segun normalizeArch:
- # armv7 -> "arm" con GOARM=7 (#458), MIPS softfloat sin FPU (#488).
- - name: Build agent binaries para embed
- env:
- CGO_ENABLED: 0
- GOOS: linux
- run: |
- set -e
- (cd agent && GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.Version=0.0.0-pr" -o ../server-go/internal/agentbin/agents/netpulse-agent-amd64 ./cmd/netpulse-agent)
- (cd agent && GOARCH=arm64 go build -trimpath -ldflags "-s -w -X main.Version=0.0.0-pr" -o ../server-go/internal/agentbin/agents/netpulse-agent-arm64 ./cmd/netpulse-agent)
- (cd agent && GOARCH=arm GOARM=7 go build -trimpath -ldflags "-s -w -X main.Version=0.0.0-pr" -o ../server-go/internal/agentbin/agents/netpulse-agent-arm ./cmd/netpulse-agent)
- (cd agent && GOARCH=mipsle GOMIPS=softfloat go build -trimpath -ldflags "-s -w -X main.Version=0.0.0-pr" -o ../server-go/internal/agentbin/agents/netpulse-agent-mipsle ./cmd/netpulse-agent)
- (cd agent && GOARCH=mips GOMIPS=softfloat go build -trimpath -ldflags "-s -w -X main.Version=0.0.0-pr" -o ../server-go/internal/agentbin/agents/netpulse-agent-mips ./cmd/netpulse-agent)
- - name: Tests server (server-go)
- working-directory: server-go
- run: go test ./...
- # Modulo separado (agent/go.mod): go test ./... en server-go no lo cubre.
- - name: Tests agente (agent)
- working-directory: agent
- run: go test ./...
|