Skip to content

Commit d107f9a

Browse files
authored
Update ci.yml
1 parent c6ac48e commit d107f9a

1 file changed

Lines changed: 4 additions & 98 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -251,29 +251,10 @@ jobs:
251251
name: mnist-RELEASE
252252
path: build/
253253

254-
- name: Verify downloaded artifacts
255-
run: |
256-
echo "### Verifying downloaded artifacts ###"
257-
echo "Current directory: $(pwd)"
258-
echo "Build directory contents:"
259-
ls -la build/ || echo "No build directory"
260-
echo "Looking for ACC binary:"
261-
find build/ -name "ACC" -type f 2>/dev/null || echo "ACC not found"
262-
echo "Checking bin directory:"
263-
ls -la build/bin/ 2>/dev/null || echo "No bin directory"
264-
265254
- name: Set binary path
266255
id: set_eval_binary
267256
run: |
268-
if [ -f "build/bin/ACC" ]; then
269-
echo "ACC binary found at build/bin/ACC"
270-
echo "EVAL_BINARY=build/bin/ACC" >> $GITHUB_OUTPUT
271-
else
272-
echo "ERROR: ACC binary not found at build/bin/ACC"
273-
echo "Available files:"
274-
find build/ -type f -name "*" 2>/dev/null | head -20
275-
exit 1
276-
fi
257+
echo "EVAL_BINARY=build/bin/ACC" >> $GITHUB_OUTPUT
277258
278259
- name: Install system dependencies
279260
run: |
@@ -309,115 +290,40 @@ jobs:
309290
run: |
310291
set -e
311292
mkdir -p docs/mnist/mnist/test
312-
echo "Downloading test images..."
313293
wget -q https://github.com/DeepTrackAI/MNIST_dataset/archive/main.zip -O main.zip
314294
unzip -q main.zip
315295
cp MNIST_dataset-main/mnist/test/*.png docs/mnist/mnist/test/
316296
rm -rf main.zip MNIST_dataset-main
317-
echo "Downloaded $(ls docs/mnist/mnist/test | wc -l) images"
318297
319298
- name: Prepare environment
320299
run: |
321-
echo "### Preparing environment ###"
322-
echo "Binary path: ${{ steps.set_eval_binary.outputs.EVAL_BINARY }}"
323-
324-
ls -la "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}"
325300
chmod +x "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}"
326-
327301
export LD_LIBRARY_PATH=$PWD/build/bin/opencv_libs:/usr/lib/x86_64-linux-gnu
328-
echo "Final LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
329-
330-
- name: Verify library integrity
331-
run: |
332-
echo "### Library verification ###"
333-
ls -la build/bin/opencv_libs/ || echo "No opencv_libs directory"
334-
file build/bin/opencv_libs/libopencv_imgcodecs.so* 2>/dev/null | head -1 || echo "No opencv_imgcodecs library found"
335-
336-
- name: Test binary execution
337-
run: |
338-
echo "### Testing binary execution ###"
339-
export LD_LIBRARY_PATH=$PWD/build/bin/opencv_libs:/usr/lib/x86_64-linux-gnu
340-
341-
echo "Binary dependencies:"
342-
ldd "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" 2>/dev/null || echo "ldd failed"
343-
344-
echo "Testing help command:"
345-
timeout 10s "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --help > /dev/null 2>&1 || echo "Help test completed"
346302
347303
- name: Run evaluation
348304
run: |
349-
echo "### Running evaluation ###"
350-
export LD_LIBRARY_PATH=$PWD/build/bin/opencv_libs:/usr/lib/x86_64-linux-gnu
351-
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
352-
353-
echo "### Checking binary execution permissions ###"
354-
ls -la "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}"
355-
file "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}"
356-
357-
echo "### Testing direct execution ###"
358-
set +e
359-
"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --version > version_output.txt 2>&1
360-
VERSION_EXIT_CODE=$?
361-
echo "Version command exit code: $VERSION_EXIT_CODE"
362-
cat version_output.txt
363-
364-
"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --help > help_output.txt 2>&1
365-
HELP_EXIT_CODE=$?
366-
echo "Help command exit code: $HELP_EXIT_CODE"
367-
cat help_output.txt
368-
369-
echo "### Running MNIST evaluation ###"
370-
mkdir -p docs/mnist/mnist/test
371-
372-
"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --model alexnet_mnist > accuracy.txt 2>&1
373-
EVAL_EXIT_CODE=$?
374-
echo "Evaluation exit code: $EVAL_EXIT_CODE"
375-
376-
if [ $EVAL_EXIT_CODE -ne 0 ]; then
377-
echo "Trying without --model parameter..."
378-
"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" > accuracy.txt 2>&1
379-
EVAL_EXIT_CODE=$?
380-
echo "Fallback evaluation exit code: $EVAL_EXIT_CODE"
381-
fi
382-
383-
echo "### Evaluation output ###"
384-
cat accuracy.txt
385-
set -e
305+
"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" > accuracy.txt
386306
387307
- name: Extract accuracy value
388308
run: |
389-
echo "### Extracting accuracy ###"
390-
ACCURACY=$(grep -oE '[0-9]+\.?[0-9]*%' accuracy.txt | head -1 || echo "0%")
391-
echo "Accuracy: $ACCURACY"
392-
echo "$ACCURACY" > accuracy_value.txt
393-
309+
grep -oE '[0-9]+\.?[0-9]*%' accuracy.txt | head -1 > accuracy_value.txt
310+
394311
- name: Update README (master only)
395312
if: github.ref == 'refs/heads/master'
396313
run: |
397314
ACCURACY=$(cat accuracy_value.txt | sed 's/%//g')
398315
DATE=$(date '+%Y-%m-%d')
399-
400-
echo "Updating README with:"
401-
echo "Accuracy: $ACCURACY%"
402-
echo "Date: $DATE"
403-
404316
sed -i "s/<!--ACCURACY_PLACEHOLDER-->.*<!--END_ACCURACY-->/<!--ACCURACY_PLACEHOLDER-->Accuracy: ${ACCURACY}% (updated: ${DATE})<!--END_ACCURACY-->/" README.md
405-
406-
echo "Updated README content:"
407-
grep -A 2 -B 2 "ACCURACY_PLACEHOLDER" README.md
408317
409318
- name: Commit and push changes (master only)
410319
if: github.ref == 'refs/heads/master'
411320
run: |
412321
git config --global user.name "GitHub Actions"
413322
git config --global user.email "actions@github.com"
414-
415323
git add README.md
416-
417324
if git diff-index --quiet HEAD --; then
418325
echo "No changes to commit"
419326
else
420327
git commit -m "[CI] Update accuracy: $(cat accuracy_value.txt)"
421328
git push origin master
422-
echo "Changes pushed to master branch"
423329
fi

0 commit comments

Comments
 (0)