debug(ci): simplify debug workflow to isolate failure
This commit is contained in:
@@ -21,33 +21,11 @@ jobs:
|
||||
- name: Install Nim dependencies
|
||||
run: nimble install --depsOnly -y
|
||||
|
||||
- name: Compile and run tests
|
||||
run: |
|
||||
nim c -d:ssl --threads:on --path:src tests/test_all.nim > compile.log 2>&1
|
||||
COMPILE_EXIT=$?
|
||||
tail -n 50 compile.log
|
||||
if [ $COMPILE_EXIT -ne 0 ]; then
|
||||
echo "COMPILE_FAILED=1" >> $GITHUB_ENV
|
||||
echo "LOG=$(cat compile.log | sed 's/"/\\"/g' | head -c 6000)" >> $GITHUB_ENV
|
||||
exit 1
|
||||
fi
|
||||
./tests/test_all > run.log 2>&1
|
||||
RUN_EXIT=$?
|
||||
tail -n 50 run.log
|
||||
if [ $RUN_EXIT -ne 0 ]; then
|
||||
echo "RUN_FAILED=1" >> $GITHUB_ENV
|
||||
echo "LOG=$(cat run.log | sed 's/"/\\"/g' | head -c 6000)" >> $GITHUB_ENV
|
||||
exit 1
|
||||
fi
|
||||
- name: Compile and run minimal test
|
||||
run: nim c -d:ssl --threads:on --path:src -r tests/test_minimal.nim
|
||||
|
||||
- name: Create issue on failure
|
||||
if: failure()
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
BODY="Debug failure log:\n\n\`\`\`\n${LOG}\n\`\`\`"
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"title\":\"CI Debug: test failure on ${{ github.sha }}\",\"body\":\"$BODY\"}" \
|
||||
https://api.github.com/repos/${{ github.repository }}/issues
|
||||
- name: Compile test_all
|
||||
run: nim c -d:ssl --threads:on --path:src tests/test_all.nim
|
||||
|
||||
- name: Run test_all binary
|
||||
run: timeout 60 ./tests/test_all || echo "EXIT_CODE=$?"
|
||||
|
||||
Reference in New Issue
Block a user