mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-01-01 19:43:41 +05:00
build: Fix using github cache (also on failure)
This commit is contained in:
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@@ -214,6 +214,7 @@ jobs:
|
|||||||
id: update
|
id: update
|
||||||
run: |
|
run: |
|
||||||
./xupdate.sh -f
|
./xupdate.sh -f
|
||||||
|
mkdir -p logs
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
@@ -291,6 +292,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Kernel compile
|
- name: Kernel compile
|
||||||
id: kernel
|
id: kernel
|
||||||
|
continue-on-error: true
|
||||||
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.first_kernel_compile == 'true' && github.event.inputs.fake_build != 'true' }}
|
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.first_kernel_compile == 'true' && github.event.inputs.fake_build != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
make target/linux/compile -j$(nproc)
|
make target/linux/compile -j$(nproc)
|
||||||
@@ -298,6 +300,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build the firmware image
|
- name: Build the firmware image
|
||||||
id: compile
|
id: compile
|
||||||
|
continue-on-error: true
|
||||||
if: steps.tools.outputs.status == 'success'
|
if: steps.tools.outputs.status == 'success'
|
||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
@@ -321,7 +324,6 @@ jobs:
|
|||||||
mkdir -p $OUT_DIR
|
mkdir -p $OUT_DIR
|
||||||
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$OUT_DIR/$G_DEVICE_NAME.txt"
|
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$OUT_DIR/$G_DEVICE_NAME.txt"
|
||||||
touch "$OUT_DIR/kernel-debug.tar.zst"
|
touch "$OUT_DIR/kernel-debug.tar.zst"
|
||||||
ls -la
|
|
||||||
BLD_VER=$FW_VER
|
BLD_VER=$FW_VER
|
||||||
else
|
else
|
||||||
BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
|
BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
|
||||||
@@ -332,12 +334,23 @@ jobs:
|
|||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
echo "DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
echo "FW_BUILD_OK=1" >> $GITHUB_ENV
|
||||||
echo "BOARD_NAME=$G_BOARD_NAME" >> $GITHUB_ENV
|
|
||||||
echo "SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
|
||||||
echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV
|
echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV
|
||||||
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Mark firmware build failed
|
||||||
|
if: steps.compile.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
echo "Firmware build failed, continuing pipeline"
|
||||||
|
echo "FW_BUILD_OK=0" >> $GITHUB_ENV
|
||||||
|
OUT_DIR=_bin_fake
|
||||||
|
mkdir -p $OUT_DIR
|
||||||
|
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$OUT_DIR/$G_DEVICE_NAME.txt"
|
||||||
|
touch "$OUT_DIR/kernel-debug.tar.zst"
|
||||||
|
echo "BUILD FAILED" > $OUT_DIR/FAILED.txt
|
||||||
|
echo "BLD_VER=$FW_VER" >> $GITHUB_ENV
|
||||||
|
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check space usage
|
- name: Check space usage
|
||||||
run: df -hT
|
run: df -hT
|
||||||
|
|
||||||
@@ -372,7 +385,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
if: steps.compile.outputs.status == 'success'
|
if: steps.compile.outputs.status == 'success'
|
||||||
with:
|
with:
|
||||||
name: openwrt-${{ env.BLD_VER }}-${{ needs.check.outputs.build_date }}-${{ env.DEVICE_NAME }}
|
name: openwrt-${{ env.BLD_VER }}-${{ needs.check.outputs.build_date }}-${{ env.G_DEVICE_NAME }}
|
||||||
path: ${{ env.OUT_DIR }}
|
path: ${{ env.OUT_DIR }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user