Skip to content

Commit

Permalink
Delete build folders after successful builds (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex authored Aug 7, 2024
1 parent 13d60df commit 9a9eac5
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/binutils/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install binutils"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $BINUTILS_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
1 change: 1 addition & 0 deletions .github/scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ RESET_SOURCES=${RESET_SOURCES:-0} # Reset source code repositories before update
APPLY_PATCHES=${APPLY_PATCHES:-1} # Patch source repositories for targets requiring it.
RUN_CONFIG=${RUN_CONFIG:-1} # Run configuration step.
RUN_INSTALL=${RUN_INSTALL:-1} # Run installation step.
DELETE_BUILD=${DELETE_BUILD:-0} # Delete build folders after successful builds.

PATH="$PATH:$TOOLCHAIN_PATH/bin"
if [[ "$CCACHE" = 1 ]]; then
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/toolchain/build-cocom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install COCOM"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $COCOM_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/toolchain/build-cygwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install Cygwin"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $CYGWIN_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/toolchain/build-gcc-stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install GCC stage1"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $GCC_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/toolchain/build-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install GCC"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $GCC_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/toolchain/build-mingw-crt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ if [[ "$RUN_INSTALL" = 1 ]]; then
popd
;;
esac

if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $MINGW_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/toolchain/build-mingw-headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ if [[ "$RUN_INSTALL" = 1 ]]; then

# Symlink for gcc
ln -sf $TOOLCHAIN_PATH/$TARGET $TOOLCHAIN_PATH/mingw

if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $MINGW_HEADERS_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/toolchain/build-mingw-winpthreads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install MinGW winpthreads"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $MINGW_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/toolchain/build-mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ echo "::endgroup::"
if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install MinGW"
make install
if [[ "$DELETE_BUILD" = 1 ]]; then
rm -rf $MINGW_BUILD_PATH
fi
echo "::endgroup::"
fi

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ env:
SOURCE_PATH: ${{ github.workspace }}/code
ARTIFACT_PATH: ${{ github.workspace }}/artifact

DELETE_BUILD: 1

jobs:
build-toolchain:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ env:
TOOLCHAIN_PATH: ${{ github.workspace }}/cross

CCACHE: 1
DELETE_BUILD: 1

jobs:
build-toolchain:
Expand Down

0 comments on commit 9a9eac5

Please sign in to comment.