@@ -17,6 +17,8 @@ permissions:
1717jobs :
1818 functionality-check :
1919 runs-on : [self-hosted, linux, x64, big]
20+ outputs :
21+ build_status : ${{ steps.build.outputs.BUILD_STATUS }}
2022 steps :
2123 - name : Checkout code
2224 uses : actions/checkout@main
@@ -42,49 +44,85 @@ jobs:
4244 - name : Install Dependencies and Build
4345 id : build
4446 run : |
45- echo "BUILD_STATUS=unknown" >> $GITHUB_OUTPUT
47+ build_status="no-project-detected"
48+ build_failed=false
49+ build_succeeded=false
50+ project_detected=false
4651
4752 # Node.js project
4853 if [ -f "package.json" ]; then
54+ project_detected=true
4955 echo "Detected Node.js project"
5056 npm install || echo "npm install failed"
5157
5258 if grep -q '"build"' package.json; then
53- npm run build && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
54- else
55- echo "BUILD_STATUS=no-build-script" >> $GITHUB_OUTPUT
59+ if npm run build; then
60+ build_succeeded=true
61+ else
62+ build_failed=true
63+ fi
5664 fi
5765 fi
5866
5967 # Python project
6068 if [ -f "requirements.txt" ] || [ -f "setup.py" ] || [ -f "pyproject.toml" ]; then
69+ project_detected=true
6170 echo "Detected Python project"
6271 if [ -f "requirements.txt" ]; then
6372 pip install -r requirements.txt || echo "pip install failed"
6473 fi
65- if [ -f "setup.py" ]; then
66- pip install -e . || echo "setup.py install failed"
74+ if [ -f "setup.py" ] || [ -f "pyproject.toml" ]; then
75+ if pip install -e .; then
76+ build_succeeded=true
77+ else
78+ build_failed=true
79+ fi
6780 fi
68- echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT
6981 fi
7082
7183 # Go project
7284 if [ -f "go.mod" ]; then
85+ project_detected=true
7386 echo "Detected Go project"
74- go build ./... && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
87+ if go build ./...; then
88+ build_succeeded=true
89+ else
90+ build_failed=true
91+ fi
7592 fi
7693
7794 # Java/Maven project
7895 if [ -f "pom.xml" ]; then
96+ project_detected=true
7997 echo "Detected Maven project"
80- mvn clean compile && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
98+ if mvn clean compile; then
99+ build_succeeded=true
100+ else
101+ build_failed=true
102+ fi
81103 fi
82104
83105 # Gradle project
84106 if [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then
107+ project_detected=true
85108 echo "Detected Gradle project"
86- ./gradlew build -x test && echo "BUILD_STATUS=success" >> $GITHUB_OUTPUT || echo "BUILD_STATUS=failed" >> $GITHUB_OUTPUT
109+ if ./gradlew build -x test; then
110+ build_succeeded=true
111+ else
112+ build_failed=true
113+ fi
87114 fi
115+
116+ if [ "$build_failed" = true ]; then
117+ build_status="failed"
118+ elif [ "$build_succeeded" = true ]; then
119+ build_status="success"
120+ elif [ "$project_detected" = true ]; then
121+ build_status="no-build-script"
122+ fi
123+
124+ echo "BUILD_STATUS=$build_status" >> "$GITHUB_OUTPUT"
125+ echo "Resolved BUILD_STATUS=$build_status"
88126 continue-on-error : true
89127
90128 - name : Run Basic Functionality Tests
@@ -104,6 +142,8 @@ jobs:
104142 continue-on-error : true
105143
106144 documentation-review :
145+ needs : functionality-check
146+ if : ${{ always() }}
107147 runs-on : [self-hosted, linux, x64, big]
108148 steps :
109149 - name : Checkout code
@@ -318,11 +358,13 @@ jobs:
318358 cat /tmp/doc-analysis.md
319359 continue-on-error : true
320360
321- - name : GitHub Copilot Documentation Review (optional)
322- if : ${{ secrets.COPILOT_TOKEN != '' }}
323- uses : austenstone/copilot-cli-action@v2
361+ - name : GitHub Copilot Documentation Review
362+ uses : austenstone/copilot-cli@v3
324363 with :
325- copilot-token : ${{ secrets.COPILOT_TOKEN }}
364+ copilot-token : ${{ secrets.COPILOT_TOKEN || github.token }}
365+ repo-token : ${{ github.token }}
366+ model : gpt-5.4
367+ reasoning-effort : xhigh
326368 prompt : |
327369 Review the documentation for this repository:
328370 1. Check README.md completeness and quality
@@ -424,4 +466,4 @@ jobs:
424466 });
425467 }
426468 env :
427- BUILD_STATUS : ${{ steps.build .outputs.BUILD_STATUS }}
469+ BUILD_STATUS : ${{ needs.functionality-check .outputs.build_status || 'unknown' }}
0 commit comments