-
Notifications
You must be signed in to change notification settings - Fork 18
Enable Drone CI #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Enable Drone CI #155
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||||||||||
|
|
||||||||||||||
| @ECHO ON | ||||||||||||||
| setlocal enabledelayedexpansion | ||||||||||||||
|
|
||||||||||||||
| set TRAVIS_OS_NAME=windows | ||||||||||||||
|
|
||||||||||||||
| IF "!DRONE_BRANCH!" == "" ( | ||||||||||||||
| for /F %%i in ("!GITHUB_REF!") do @set TRAVIS_BRANCH=%%~nxi | ||||||||||||||
| ) else ( | ||||||||||||||
| SET TRAVIS_BRANCH=!DRONE_BRANCH! | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| if "%DRONE_JOB_BUILDTYPE%" == "boost" ( | ||||||||||||||
|
|
||||||||||||||
| echo "Running boost job" | ||||||||||||||
| echo '==================================> INSTALL' | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Single quotes are printed literally in
Proposed fix-echo '==================================> INSTALL'
+echo ==================================^> INSTALLNote: 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| REM there seems to be some problem with b2 bootstrap on Windows | ||||||||||||||
| REM when CXX env variable is set | ||||||||||||||
| SET "CXX=" | ||||||||||||||
|
|
||||||||||||||
| git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1 | ||||||||||||||
| cp -prf boost-ci-cloned/ci . | ||||||||||||||
| rm -rf boost-ci-cloned | ||||||||||||||
|
Comment on lines
+21
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .drone/drone.batRepository: cppalliance/capy Length of output: 1670 🏁 Script executed: #!/bin/bash
# Check if other .bat files in the repo also use Unix commands like cp/rm
rg -n '\b(cp |rm |ls |mv |cat |grep )\b' --type-add 'bat:*.bat' --type batRepository: cppalliance/capy Length of output: 42 🏁 Script executed: find . -name "*.yml" -o -name "*.yaml" | head -20Repository: cppalliance/capy Length of output: 246 🏁 Script executed: rg -l "drone" --type ymlRepository: cppalliance/capy Length of output: 87 🏁 Script executed: find . -name ".drone*" -type f | head -20Repository: cppalliance/capy Length of output: 73 🏁 Script executed: cat -n .drone.starRepository: cppalliance/capy Length of output: 1428 🏁 Script executed: ls -la .drone/Repository: cppalliance/capy Length of output: 291 Use native Windows commands instead of Unix utilities in batch file. Lines 22–23 use Suggested fix-cp -prf boost-ci-cloned/ci .
-rm -rf boost-ci-cloned
+xcopy /s /e /q /y boost-ci-cloned\ci ci\
+rmdir /s /q boost-ci-cloned📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| REM source ci/travis/install.sh | ||||||||||||||
| REM The contents of install.sh below: | ||||||||||||||
|
|
||||||||||||||
| for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi | ||||||||||||||
| SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH! | ||||||||||||||
| SET BOOST_CI_SRC_FOLDER=%cd% | ||||||||||||||
| if "%BOOST_BRANCH%" == "" ( | ||||||||||||||
| SET BOOST_BRANCH=develop | ||||||||||||||
| if "%BOOST_CI_TARGET_BRANCH%" == "master" set BOOST_BRANCH=master | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| call ci\common_install.bat | ||||||||||||||
|
|
||||||||||||||
| echo '==================================> ZLIB' | ||||||||||||||
| git clone --branch v1.2.13 https://github.com/madler/zlib.git !BOOST_ROOT!\zlib-src --depth 1 | ||||||||||||||
| set ZLIB_SOURCE=!BOOST_ROOT!\zlib-src | ||||||||||||||
|
|
||||||||||||||
| echo '==================================> COMPILE' | ||||||||||||||
|
|
||||||||||||||
| REM set B2_TARGETS=libs/!SELF!/test libs/!SELF!/example | ||||||||||||||
| set B2_TARGETS=libs/!SELF!/test | ||||||||||||||
| call !BOOST_ROOT!\libs\!SELF!\ci\build.bat | ||||||||||||||
|
|
||||||||||||||
| ) | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Copyright 2020 Rene Rivera, Sam Darwin | ||
| # Distributed under the Boost Software License, Version 1.0. | ||
| # (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt) | ||
|
|
||
| set -xe | ||
|
|
||
| export DRONE_BUILD_DIR=$(pwd) | ||
| export VCS_COMMIT_ID=$DRONE_COMMIT | ||
| export GIT_COMMIT=$DRONE_COMMIT | ||
| export REPO_NAME=$DRONE_REPO | ||
| export USER=$(whoami) | ||
| export CC=${CC:-gcc} | ||
| export PATH=~/.local/bin:/usr/local/bin:$PATH | ||
| export TRAVIS_BUILD_DIR=$(pwd) | ||
| export TRAVIS_BRANCH=$DRONE_BRANCH | ||
| export TRAVIS_EVENT_TYPE=$DRONE_BUILD_EVENT | ||
|
|
||
| common_install () { | ||
| if [ -z "$SELF" ]; then | ||
| export SELF=`basename $REPO_NAME` | ||
| fi | ||
|
|
||
| git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1 | ||
| [ "$SELF" == "boost-ci" ] || cp -prf boost-ci-cloned/ci . | ||
| rm -rf boost-ci-cloned | ||
|
|
||
| if [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
| unset -f cd | ||
| fi | ||
|
|
||
| export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH" | ||
| export BOOST_CI_SRC_FOLDER=$(pwd) | ||
|
|
||
| . ./ci/common_install.sh | ||
| } | ||
|
|
||
| if [[ $(uname) == "Linux" && "$B2_ASAN" == "1" ]]; then | ||
| echo 0 | sudo tee /proc/sys/kernel/randomize_va_space > /dev/null | ||
| fi | ||
|
|
||
| if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then | ||
|
|
||
| echo '==================================> INSTALL' | ||
|
|
||
| common_install | ||
|
|
||
| echo '==================================> SCRIPT' | ||
|
|
||
| . $BOOST_ROOT/libs/$SELF/ci/build.sh | ||
|
|
||
| elif [ "$DRONE_JOB_BUILDTYPE" == "codecov" ]; then | ||
|
|
||
| echo '==================================> INSTALL' | ||
|
|
||
| common_install | ||
|
|
||
| echo '==================================> SCRIPT' | ||
|
|
||
| cd $BOOST_ROOT/libs/$SELF | ||
| ci/travis/codecov.sh | ||
|
|
||
| elif [ "$DRONE_JOB_BUILDTYPE" == "valgrind" ]; then | ||
|
|
||
| echo '==================================> INSTALL' | ||
|
|
||
| common_install | ||
|
|
||
| echo '==================================> SCRIPT' | ||
|
|
||
| cd $BOOST_ROOT/libs/$SELF | ||
| ci/travis/valgrind.sh | ||
|
|
||
| elif [ "$DRONE_JOB_BUILDTYPE" == "coverity" ]; then | ||
|
|
||
| echo '==================================> INSTALL' | ||
|
|
||
| common_install | ||
|
|
||
| echo '==================================> SCRIPT' | ||
|
|
||
| if [ -n "${COVERITY_SCAN_NOTIFICATION_EMAIL}" -a \( "$TRAVIS_BRANCH" = "develop" -o "$TRAVIS_BRANCH" = "master" \) -a \( "$DRONE_BUILD_EVENT" = "push" -o "$DRONE_BUILD_EVENT" = "cron" \) ] ; then | ||
| cd $BOOST_ROOT/libs/$SELF | ||
| ci/travis/coverity.sh | ||
| fi | ||
|
|
||
| elif [ "$DRONE_JOB_BUILDTYPE" == "cmake1" ]; then | ||
|
|
||
| set -xe | ||
|
|
||
| echo '==================================> INSTALL' | ||
|
|
||
| # already in the image | ||
| # pip install --user cmake | ||
|
|
||
| echo '==================================> SCRIPT' | ||
|
|
||
| export SELF=`basename $REPO_NAME` | ||
| BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "master" ] && BOOST_BRANCH=master || true | ||
| echo BOOST_BRANCH: $BOOST_BRANCH | ||
| cd .. | ||
| git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root | ||
| cd boost-root | ||
|
|
||
| mkdir -p libs/$SELF | ||
| cp -r $DRONE_BUILD_DIR/* libs/$SELF | ||
| # git submodule update --init tools/boostdep | ||
| git submodule update --init --recursive | ||
|
|
||
| cd libs/$SELF | ||
| mkdir __build__ && cd __build__ | ||
| cmake -DCMAKE_INSTALL_PREFIX=~/.local .. | ||
| cmake --build . --target install | ||
|
|
||
| elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-superproject" ]; then | ||
|
|
||
| echo '==================================> INSTALL' | ||
|
|
||
| common_install | ||
|
|
||
| echo '==================================> COMPILE' | ||
|
|
||
| # Warnings as errors -Werror not building. Remove for now: | ||
| # export CXXFLAGS="-Wall -Wextra -Werror" | ||
| export CXXFLAGS="-Wall -Wextra" | ||
| export CMAKE_OPTIONS=${CMAKE_OPTIONS:--DBUILD_TESTING=ON} | ||
| export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1} | ||
|
|
||
| mkdir __build_static | ||
| cd __build_static | ||
| cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \ | ||
| -DBOOST_INCLUDE_LIBRARIES=$SELF .. | ||
| cmake --build . | ||
| ctest --output-on-failure -R boost_$SELF | ||
|
|
||
| cd .. | ||
|
|
||
| if [ "$CMAKE_SHARED_LIBS" = 1 ]; then | ||
|
|
||
| mkdir __build_shared | ||
| cd __build_shared | ||
| cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \ | ||
| -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON .. | ||
| cmake --build . | ||
| ctest --output-on-failure -R boost_$SELF | ||
|
|
||
| fi | ||
|
|
||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: cppalliance/capy
Length of output: 322
🏁 Script executed:
Repository: cppalliance/capy
Length of output: 595
Critical: Batch file must use Windows (CRLF) line endings.
The file
.drone/drone.batuses Unix (LF-only) line endings. The Windowscmd.exebatch parser has known bugs with LF-only files — particularly around GOTO/CALL label resolution near 512-byte boundaries — which can cause silent script malfunction. Additionally, the current.gitattributesrule (* text=auto eol=lf) enforces LF line endings for all text files, including batch files.Add a specific
.gitattributesentry to override this for batch files:🧰 Tools
🪛 Blinter (1.0.112)
[error] 1-1: Unix line endings detected. Explanation: Batch file uses Unix line endings (LF-only) which can cause GOTO/CALL label parsing failures and script malfunction due to Windows batch parser 512-byte boundary bugs. Recommendation: Convert file to Windows line endings (CRLF). Use tools like dos2unix, notepad++, or configure git with 'git config core.autocrlf true'. Context: File uses Unix line endings (LF-only) - 47 LF sequences found
(E018)
🤖 Prompt for AI Agents