chore(ci): always upload build logs for CPN runs (#6682)
This commit is contained in:
@@ -46,16 +46,40 @@ jobs:
|
|||||||
working-directory: ${{github.workspace}}
|
working-directory: ${{github.workspace}}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir output && \
|
mkdir output && mkdir logs && \
|
||||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
|
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
||||||
|
|
||||||
|
- name: Collect build logs
|
||||||
|
if: always()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Create logs directory if it doesn't exist
|
||||||
|
mkdir -p logs
|
||||||
|
|
||||||
|
# Copy all build logs from the build directory
|
||||||
|
if [ -d "build" ]; then
|
||||||
|
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Compose release filename
|
- name: Compose release filename
|
||||||
|
if: always()
|
||||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||||
run: echo "artifact_name=edgetx-cpn-linux-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
run: echo "artifact_name=edgetx-cpn-linux-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Archive production artifacts
|
- name: Archive production artifacts
|
||||||
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ env.artifact_name }}"
|
name: "${{ env.artifact_name }}"
|
||||||
path: ${{github.workspace}}/output
|
path: ${{github.workspace}}/output
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
|
|
||||||
|
- name: Archive build logs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "${{ env.artifact_name }}-logs"
|
||||||
|
path: ${{github.workspace}}/logs
|
||||||
|
retention-days: 30
|
||||||
|
|||||||
@@ -74,16 +74,40 @@ jobs:
|
|||||||
working-directory: ${{github.workspace}}
|
working-directory: ${{github.workspace}}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir output && \
|
mkdir output && mkdir logs && \
|
||||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
|
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
||||||
|
|
||||||
|
- name: Collect build logs
|
||||||
|
if: always()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Create logs directory if it doesn't exist
|
||||||
|
mkdir -p logs
|
||||||
|
|
||||||
|
# Copy all build logs from the build directory
|
||||||
|
if [ -d "build" ]; then
|
||||||
|
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Compose release filename
|
- name: Compose release filename
|
||||||
|
if: always()
|
||||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||||
run: echo "artifact_name=edgetx-cpn-osx-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
run: echo "artifact_name=edgetx-cpn-osx-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Archive production artifacts
|
- name: Archive production artifacts
|
||||||
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ env.artifact_name }}"
|
name: "${{ env.artifact_name }}"
|
||||||
path: ${{github.workspace}}/output
|
path: ${{github.workspace}}/output
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
|
|
||||||
|
- name: Archive build logs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "${{ env.artifact_name }}-logs"
|
||||||
|
path: ${{github.workspace}}/logs
|
||||||
|
retention-days: 30
|
||||||
|
|||||||
@@ -75,17 +75,41 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
mkdir output && \
|
mkdir output && mkdir logs && \
|
||||||
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
|
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
|
||||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
|
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
||||||
|
|
||||||
|
- name: Collect build logs
|
||||||
|
if: always()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Create logs directory if it doesn't exist
|
||||||
|
mkdir -p logs
|
||||||
|
|
||||||
|
# Copy all build logs from the build directory
|
||||||
|
if [ -d "build" ]; then
|
||||||
|
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Compose release filename
|
- name: Compose release filename
|
||||||
|
if: always()
|
||||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||||
run: echo "artifact_name=edgetx-cpn-win64-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
run: echo "artifact_name=edgetx-cpn-win64-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Archive production artifacts
|
- name: Archive production artifacts
|
||||||
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ env.artifact_name }}"
|
name: "${{ env.artifact_name }}"
|
||||||
path: ${{github.workspace}}/output
|
path: ${{github.workspace}}/output
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
|
|
||||||
|
- name: Archive build logs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "${{ env.artifact_name }}-logs"
|
||||||
|
path: ${{github.workspace}}/logs
|
||||||
|
retention-days: 30
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ if [[ -z ${OUTDIR} ]]; then
|
|||||||
OUTDIR="$(pwd)/output"
|
OUTDIR="$(pwd)/output"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create a master log file for the entire build process
|
||||||
|
MASTER_LOG="build-summary.log"
|
||||||
|
|
||||||
QUIET_FLAGS=""
|
QUIET_FLAGS=""
|
||||||
if [[ "$CMAKE_GENERATOR" == "Ninja" ]]; then
|
if [[ "$CMAKE_GENERATOR" == "Ninja" ]]; then
|
||||||
QUIET_FLAGS="-- --quiet"
|
QUIET_FLAGS="-- --quiet"
|
||||||
@@ -58,11 +61,20 @@ output_error_log() {
|
|||||||
|
|
||||||
if [[ -f "$log_file" ]]; then
|
if [[ -f "$log_file" ]]; then
|
||||||
echo "------------------------------------------"
|
echo "------------------------------------------"
|
||||||
echo " Full error output from $log_file:"
|
echo " Full error output from $log_file ($context):"
|
||||||
echo "------------------------------------------"
|
echo "------------------------------------------"
|
||||||
cat "$log_file"
|
cat "$log_file"
|
||||||
|
echo "------------------------------------------"
|
||||||
|
|
||||||
|
# Also append to master log for aggregation
|
||||||
|
{
|
||||||
|
echo "=== Error from $log_file ($context) ==="
|
||||||
|
cat "$log_file"
|
||||||
|
echo "=== End of $log_file ==="
|
||||||
|
} >> "$MASTER_LOG"
|
||||||
else
|
else
|
||||||
echo "⚠️ Warning: Log file $log_file not found for $context"
|
echo "⚠️ Warning: Log file $log_file not found for $context"
|
||||||
|
echo "⚠️ Warning: Log file $log_file not found for $context" >> "$MASTER_LOG"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user