Skip to content

Commit

Permalink
Optimize build for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Aug 5, 2024
1 parent a05eaee commit 8658360
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
18 changes: 11 additions & 7 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ if [[ "$CCACHE" = 1 ]]; then
ccache -sv
fi

.github/scripts/binutils/build.sh
if [[ "$TEST" = 0 ]]; then
.github/scripts/binutils/build.sh
fi

if [[ "$PLATFORM" =~ linux ]]; then
.github/scripts/toolchain/install-cross-headers-libs.sh
Expand All @@ -39,7 +41,7 @@ if [[ "$PLATFORM" =~ cygwin ]]; then
.github/scripts/toolchain/install-cygwin-headers.sh
fi

if [[ "$BUILD" != "$TARGET" ]]; then
if [[ "$BUILD" != "$TARGET" && "$TEST" = 0 ]]; then
.github/scripts/toolchain/build-gcc-stage1.sh
fi

Expand All @@ -63,11 +65,13 @@ fi

.github/scripts/toolchain/build-gcc.sh

if [[ "$PLATFORM" =~ (mingw|cygwin) ]]; then
.github/scripts/toolchain/build-mingw.sh
fi
if [[ "$PLATFORM" =~ cygwin ]]; then
.github/scripts/toolchain/build-cygwin.sh 2
if [[ "$TEST" = 0 ]]; then
if [[ "$PLATFORM" =~ (mingw|cygwin) ]]; then
.github/scripts/toolchain/build-mingw.sh
fi
if [[ "$PLATFORM" =~ cygwin ]]; then
.github/scripts/toolchain/build-cygwin.sh 2
fi
fi

if [[ "$CCACHE" = 1 ]]; then
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ CCACHE_LIB_DIR=/usr/lib/ccache
TOOLCHAIN_CCACHE_LIB_DIR=$TOOLCHAIN_PATH/lib/ccache

DEBUG=${DEBUG:-0} # Enable debug build.
TEST=${TEST:-0} # Enable build for testing.
CCACHE=${CCACHE:-0} # Enable usage of ccache.
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0} # Bootstrap dependencies during the build.
UPDATE_SOURCES=${UPDATE_SOURCES:-0} # Update source code repositories.
Expand Down
8 changes: 5 additions & 3 deletions .github/scripts/install-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ echo "::group::Install libraries"
./contrib/download_prerequisites

# Symbolic links for binutils dependencies
cd $SOURCE_PATH/$BINUTILS_VERSION
ln -sf $SOURCE_PATH/$GCC_VERSION/gmp gmp
ln -sf $SOURCE_PATH/$GCC_VERSION/mpfr mpfr
if [[ "$TEST" = 0 ]]; then
cd $SOURCE_PATH/$BINUTILS_VERSION
ln -sf $SOURCE_PATH/$GCC_VERSION/gmp gmp
ln -sf $SOURCE_PATH/$GCC_VERSION/mpfr mpfr
fi

echo "::endgroup::"

Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/update-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ echo "::group::Update source code repositories"
mkdir -p "$SOURCE_PATH"

cd "$SOURCE_PATH"
update_repository "$BINUTILS_VERSION" https://github.com/Windows-on-ARM-Experiments/binutils-woarm64.git woarm64
if [[ "$TEST" = 0 ]]; then
update_repository "$BINUTILS_VERSION" https://github.com/Windows-on-ARM-Experiments/binutils-woarm64.git woarm64
fi
update_repository "$GCC_VERSION" https://github.com/Windows-on-ARM-Experiments/gcc-woarm64.git woarm64
update_repository "$MINGW_VERSION" https://github.com/Windows-on-ARM-Experiments/mingw-woarm64.git woarm64
if [[ "$PLATFORM" =~ cygwin ]]; then
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-and-test-toolchain.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build toolchain

on:
pull_request:
workflow_dispatch:
inputs:
binutils_branch:
Expand Down Expand Up @@ -68,6 +69,7 @@ env:
DOWNLOADS_PATH: /root/downloads
ARTIFACT_PATH: /root/artifacts

TEST: 1
RUN_BOOTSTRAP: 1

jobs:
Expand All @@ -76,7 +78,7 @@ jobs:
runs-on: windows-latest

env:
WSLENV: BINUTILS_REPO:BINUTILS_BRANCH:BINUTILS_VERSION:GCC_REPO:GCC_BRANCH:GCC_VERSION:MINGW_REPO:MINGW_BRANCH:MINGW_VERSION:ARCH:PLATFORM:CRT:SOURCE_PATH:DOWNLOADS_PATH:ARTIFACT_PATH:RUN_BOOTSTRAP
WSLENV: BINUTILS_REPO:BINUTILS_BRANCH:BINUTILS_VERSION:GCC_REPO:GCC_BRANCH:GCC_VERSION:MINGW_REPO:MINGW_BRANCH:MINGW_VERSION:ARCH:PLATFORM:CRT:SOURCE_PATH:DOWNLOADS_PATH:ARTIFACT_PATH:TEST:RUN_BOOTSTRAP

defaults:
run:
Expand Down

0 comments on commit 8658360

Please sign in to comment.