diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index d2ee85ef1..65216ce4e 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -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 @@ -39,7 +41,7 @@ if [[ "$PLATFORM" =~ cygwin ]]; then .github/scripts/toolchain/install-cygwin-headers.sh fi -if [[ "$BUILD" != "$TARGET" ]]; then +if [[ "$BUILD" != "$HOST" && "$TEST" = 0 ]]; then .github/scripts/toolchain/build-gcc-stage1.sh fi @@ -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 diff --git a/.github/scripts/config.sh b/.github/scripts/config.sh index 0a6184d1c..d56c6feb8 100644 --- a/.github/scripts/config.sh +++ b/.github/scripts/config.sh @@ -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. diff --git a/.github/scripts/install-libraries.sh b/.github/scripts/install-libraries.sh index d661ed930..edaac8881 100755 --- a/.github/scripts/install-libraries.sh +++ b/.github/scripts/install-libraries.sh @@ -9,9 +9,12 @@ 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 + ln -sf $SOURCE_PATH/$GCC_VERSION/isl isl + fi echo "::endgroup::" diff --git a/.github/scripts/update-sources.sh b/.github/scripts/update-sources.sh index c62be67e8..560a63dc4 100755 --- a/.github/scripts/update-sources.sh +++ b/.github/scripts/update-sources.sh @@ -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 diff --git a/.github/workflows/build-and-test-toolchain.yml b/.github/workflows/build-and-test-toolchain.yml index b1889ea31..eb81940a6 100644 --- a/.github/workflows/build-and-test-toolchain.yml +++ b/.github/workflows/build-and-test-toolchain.yml @@ -1,6 +1,7 @@ name: Build toolchain on: + pull_request: workflow_dispatch: inputs: binutils_branch: @@ -68,6 +69,7 @@ env: DOWNLOADS_PATH: /root/downloads ARTIFACT_PATH: /root/artifacts + TEST: 1 RUN_BOOTSTRAP: 1 jobs: @@ -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: