Files
wdipl-actions/.gitea/workflows/build.yml
WDI-Ideas 821abc7d0b fix(ci): inline build job so sonar sees needs.build.outputs.cs
WDIPL-Runner does not propagate reusable workflow outputs to the parent; sonar
if was false. Inline build mirrors meta output pattern. Add skip_node_compile
for fast pipeline checks.

Made-with: Cursor
2026-04-08 00:13:05 +05:30

61 lines
1.8 KiB
YAML

# Standalone build workflow. Central CI inlines these steps in ci.yml because WDIPL-Runner
# does not forward reusable-workflow outputs to the parent reliably.
name: Build
on:
workflow_call:
inputs:
tech_stack:
type: string
required: true
build_command:
type: string
required: false
# Snapshot from parent needs.meta.outputs.cs so later jobs read needs.build.outputs.cs
# (WDIPL-Runner clears needs.meta.outputs after the first reusable child completes.)
ci_steps:
type: string
required: true
skip_node_compile:
type: string
required: false
outputs:
cs:
description: ci_steps snapshot for parent sonar/deploy if
value: ${{ jobs.build.outputs.cs }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
cs: ${{ inputs.ci_steps }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
# 🟢 NODE / REACT / NESTJS
- name: Setup Node
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build (Node / React / NestJS)
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
run: |
if [ "${{ inputs.skip_node_compile }}" = "true" ]; then
echo "TEMP: skip npm install / npm run build (skip_node_compile=true)"
exit 0
fi
if [ -n "${{ inputs.build_command }}" ]; then
set -xe
echo "Running custom build command"
${{ inputs.build_command }}
else
set -xe
npm install
npm run build
fi