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
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# 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:
|
||||
@@ -14,6 +16,9 @@ on:
|
||||
ci_steps:
|
||||
type: string
|
||||
required: true
|
||||
skip_node_compile:
|
||||
type: string
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
cs:
|
||||
@@ -40,6 +45,10 @@ jobs:
|
||||
- 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"
|
||||
|
||||
@@ -6,8 +6,9 @@ on:
|
||||
# WDIPL-Runner v0.2.12: only the first truthy workflow_call flag reached nested jobs; the rest
|
||||
# were empty. Use ONE comma-separated input so Act forwards a single string with all steps.
|
||||
# Tokens: build, sonar, deploy (e.g. build,sonar,deploy). No spaces — WDIPL-Runner has no replace().
|
||||
# Runner drops inputs.ci_steps after the first reusable child; `meta` captures it. WDIPL-Runner then
|
||||
# clears needs.meta.outputs before sonar/deploy — pass the string into build.yml and use needs.build.outputs.cs.
|
||||
# WDIPL-Runner: needs.meta.outputs is empty when evaluating sonar after a reusable child completes.
|
||||
# Reusable workflow outputs from build.yml did not surface as needs.build.outputs.cs. Inline `build` job
|
||||
# below snapshots ci_steps into job outputs (same pattern as `meta`) so sonar/deploy see needs.build.outputs.cs.
|
||||
ci_steps:
|
||||
type: string
|
||||
required: true
|
||||
@@ -43,6 +44,10 @@ on:
|
||||
pm2_id:
|
||||
type: string
|
||||
required: false
|
||||
# Set to 'true' to skip npm install / npm run build (temporary pipeline debugging).
|
||||
skip_node_compile:
|
||||
type: string
|
||||
required: false
|
||||
|
||||
secrets:
|
||||
SONAR_HOST_URL:
|
||||
@@ -94,15 +99,43 @@ jobs:
|
||||
outputs:
|
||||
cs: ${{ steps.snap.outputs.cs }}
|
||||
|
||||
# 🔨 BUILD
|
||||
# 🔨 BUILD (inlined — reusable build.yml outputs are not exposed to this parent on WDIPL-Runner)
|
||||
build:
|
||||
if: ${{ contains(format(',{0},', needs.meta.outputs.cs), ',build,') }}
|
||||
needs: [meta]
|
||||
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cs: ${{ steps.capture.outputs.cs }}
|
||||
steps:
|
||||
- id: capture
|
||||
name: Capture ci_steps for sonar/deploy if
|
||||
run: echo "cs=${{ inputs.ci_steps }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs'
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
tech_stack: ${{ inputs.tech_stack }}
|
||||
build_command: ${{ inputs.build_command }}
|
||||
ci_steps: ${{ needs.meta.outputs.cs }}
|
||||
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
|
||||
|
||||
# 🔍 SONAR
|
||||
sonar:
|
||||
|
||||
Reference in New Issue
Block a user