2929 default : false
3030 extra_cmake_options :
3131 type : string
32- monitor_memory :
33- type : boolean
34- default : false
3532
3633 workflow_call :
3734 inputs :
5249 type : boolean
5350 extra_cmake_options :
5451 type : string
55- monitor_memory :
56- type : boolean
57- default : false
5852
5953# See the details regarding permissions from the link:
6054# https://github.com/aws-actions/configure-aws-credentials?tab=readme-ov-file#oidc
7670 options : -v /runner/config:/home/awsconfig/
7771 env :
7872 AWS_SHARED_CREDENTIALS_FILE : /home/awsconfig/credentials.ini
79- BUILD_DIR : build
8073 CACHE_DIR : ${{ github.workspace }}/.container-cache
8174 # The ccache.conf will be written by setup_ccache.py before this gets used.
8275 CCACHE_CONFIGPATH : ${{ github.workspace }}/.ccache/ccache.conf
@@ -125,84 +118,39 @@ jobs:
125118 amdgpu_families : ${{ inputs.amdgpu_families }}
126119 package_version : ${{ inputs.package_version }}
127120 extra_cmake_options : ${{ inputs.extra_cmake_options }}
121+ BUILD_DIR : build
128122 run : |
129123 python3 build_tools/github_actions/build_configure.py --manylinux
130124
131- - name : Start memory monitoring
132- if : ${{ inputs.monitor_memory }}
133- id : memory-monitor
134- shell : bash
135- continue-on-error : true
136- run : |
137- # Create logs directory in BUILD_DIR
138- mkdir -p "${{ env.BUILD_DIR }}/logs"
139-
140- # Start memory monitor in background
141- python build_tools/memory_monitor.py \
142- --phase "Build Phase" \
143- --log-file "${{ env.BUILD_DIR }}/logs/build_memory_log_${{ github.job }}.jsonl" \
144- --background > "${{ env.BUILD_DIR }}/logs/monitor_output_${{ github.job }}.txt" 2>&1 &
145-
146- # Capture PID
147- MONITOR_PID=$!
148- echo "monitor-pid=$MONITOR_PID" >> $GITHUB_OUTPUT
149- echo "Memory monitoring started with PID: $MONITOR_PID"
150- sleep 2
151-
152125 - name : Build therock-archives and therock-dist
153126 run : |
154- cmake --build ${{ env.BUILD_DIR }} --target therock-archives therock-dist -- -k 0
155-
156- - name : Stop memory monitoring
157- if : ${{ always() && inputs.monitor_memory && steps.memory-monitor.outputs.monitor-pid }}
158- shell : bash
159- continue-on-error : true
160- env :
161- MONITOR_PID : ${{ steps.memory-monitor.outputs.monitor-pid }}
162- run : |
163- echo "Stopping memory monitor (PID: $MONITOR_PID)"
164-
165- # Send interrupt signal to stop monitoring gracefully
166- if kill -0 $MONITOR_PID 2>/dev/null; then
167- kill -SIGINT $MONITOR_PID
168- sleep 2
169- # Force kill if still running
170- kill -9 $MONITOR_PID 2>/dev/null || true
171- fi
172-
173- echo "Memory monitor stopped"
174-
175- # Display the monitor output
176- if [ -f "${{ env.BUILD_DIR }}/logs/monitor_output_${{ github.job }}.txt" ]; then
177- echo "=== Memory Monitor Output ==="
178- cat "${{ env.BUILD_DIR }}/logs/monitor_output_${{ github.job }}.txt"
179- fi
127+ cmake --build build --target therock-archives therock-dist -- -k 0
180128
181129 - name : Test Packaging
182130 if : ${{ github.event.repository.name == 'TheRock' }}
183131 run : |
184- ctest --test-dir ${{ env.BUILD_DIR }} --output-on-failure
132+ ctest --test-dir build --output-on-failure
185133
186134 - name : Report
187135 if : ${{ !cancelled() }}
188136 shell : bash
189137 run : |
190- if [ -d "${{ env.BUILD_DIR }} " ]; then
138+ if [ -d "./build " ]; then
191139 echo "Full SDK du:"
192140 echo "------------"
193- du -h -d 1 ${{ env.BUILD_DIR }} /dist/rocm
141+ du -h -d 1 build /dist/rocm
194142 echo "Artifact Archives:"
195143 echo "------------------"
196- ls -lh ${{ env.BUILD_DIR }} /artifacts/*.tar.xz
144+ ls -lh build /artifacts/*.tar.xz
197145 echo "Artifacts:"
198146 echo "----------"
199- du -h -d 1 ${{ env.BUILD_DIR }} /artifacts
147+ du -h -d 1 build /artifacts
200148 echo "CCache Stats:"
201149 echo "-------------"
202150 ccache -s -v
203- tail -v -n +1 .ccache/compiler_check_cache/* > ${{ env.BUILD_DIR }} /logs/ccache_compiler_check_cache.log
151+ tail -v -n +1 .ccache/compiler_check_cache/* > build /logs/ccache_compiler_check_cache.log
204152 else
205- echo "[ERROR] Build directory ${{ env.BUILD_DIR }} does not exist. Skipping report!"
153+ echo "[ERROR] Build directory ./build does not exist. Skipping report!"
206154 echo " This should only happen if the CI is cancelled before the build step."
207155 exit 1
208156 fi
@@ -220,7 +168,7 @@ jobs:
220168 python3 build_tools/github_actions/post_build_upload.py \
221169 --run-id ${{ github.run_id }} \
222170 --artifact-group "${{ inputs.artifact_group }}" \
223- --build-dir ${{ env.BUILD_DIR }} \
171+ --build-dir build \
224172 --upload
225173
226174 # - name: Upload job metrics to Redshift database
0 commit comments