-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add shellcheck to the build #3476
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| if [ "$TYPE" != 'style' ]; then | ||
| ccache -s | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| if [ "$TYPE" = 'style' ]; then | ||
| sudo apt-get -yqq update | ||
| sudo apt-get install shellcheck | ||
| else | ||
| "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.before_install.sh" | ||
| "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.install.sh" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| # shellcheck disable=SC2086 | ||
| cmake -DUSE_WERROR=ON $CMAKE_FLAGS .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y | ||
| sudo apt-get update -qq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" | ||
| ../cmake/build_mingw32.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| . .travis/linux.win32.before_install.sh | ||
| set -e | ||
|
|
||
| "$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" | ||
| ../cmake/build_mingw64.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| brew update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,40 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| PACKAGES="cmake pkgconfig fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk" | ||
| set -e | ||
|
|
||
| PACKAGES="cmake pkg-config fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk" | ||
|
|
||
| if [ "$QT5" ]; then | ||
| PACKAGES="$PACKAGES homebrew/versions/qt55" | ||
| PACKAGES="$PACKAGES [email protected]" | ||
| else | ||
| PACKAGES="$PACKAGES cartr/qt4/qt" | ||
| PACKAGES="$PACKAGES cartr/qt4/qt@4" | ||
| fi | ||
|
|
||
| if "${TRAVIS}"; then | ||
| PACKAGES="$PACKAGES ccache" | ||
| fi | ||
|
|
||
| # removing already installed packages from the list | ||
| for p in $(brew list); do | ||
| PACKAGES=${PACKAGES//$p/} | ||
| done; | ||
|
|
||
| # shellcheck disable=SC2086 | ||
| brew install $PACKAGES ccache | ||
| brew install $PACKAGES | ||
|
|
||
| # Recompile fluid-synth without CoreAudio per issues #649 | ||
| # Changes to fluid-synth.rb must be pushed to URL prior to use | ||
| url=$(git remote get-url origin) | ||
| branch=$(git symbolic-ref --short HEAD) | ||
| brew install --build-from-source "$url/raw/$branch/cmake/apple/fluid-synth.rb" | ||
| if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then | ||
| slug=$TRAVIS_PULL_REQUEST_SLUG | ||
| branch=$TRAVIS_PULL_REQUEST_BRANCH | ||
| elif "${TRAVIS}"; then | ||
| slug=$TRAVIS_REPO_SLUG | ||
| branch=$TRAVIS_BRANCH | ||
| else | ||
| slug="LMMS/lmms" | ||
| branch=$(git symbolic-ref --short HEAD) | ||
| fi | ||
|
|
||
| brew install --build-from-source "https://raw.githubusercontent.com/${slug}/${branch}/cmake/apple/fluid-synth.rb" | ||
|
|
||
| sudo npm install -g appdmg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| if [ "$TYPE" = 'style' ]; then | ||
|
|
||
| # shellcheck disable=SC2046 | ||
| shellcheck $(find -O3 "$TRAVIS_BUILD_DIR/.travis/" "$TRAVIS_BUILD_DIR/cmake/" -type f -name '*.sh' -o -name "*.sh.in") | ||
|
|
||
| else | ||
|
|
||
| mkdir build | ||
| cd build | ||
|
|
||
| export CMAKE_FLAGS="-DWANT_QT5=$QT5 -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo" | ||
|
|
||
| if [ -z "$TRAVIS_TAG" ]; then | ||
| export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON" | ||
| fi | ||
|
|
||
| "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh" | ||
|
|
||
| make -j4 | ||
|
|
||
| if [[ $TARGET_OS != win* ]]; then | ||
|
|
||
| make tests | ||
| tests/tests | ||
|
|
||
| fi | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,16 @@ | |
| # Examine linkings using `otool -L somelib.so` | ||
| # Debug the loading of dynamic libraries using `export DYLD_PRINT_LIBRARIES=1` | ||
|
|
||
| set -e | ||
|
|
||
| # STK rawwaves directory | ||
| STK_RAWWAVE=$HOME/stk-*/rawwaves | ||
| STK_RAWWAVE_LIST=( $HOME/stk-*/rawwaves ) | ||
| STK_RAWWAVE=${STK_RAWWAVE_LIST[0]} | ||
|
|
||
| if [ ! -d "$STK_RAWWAVE" ]; then | ||
| STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves | ||
| fi | ||
|
|
||
| # Place to create ".app" bundle | ||
| APP="@CMAKE_BINARY_DIR@/@[email protected]" | ||
|
|
||
|
|
@@ -24,29 +27,30 @@ if [ $? -ne 0 ]; then | |
| brew --prefix qt55 > /dev/null 2>&1 | ||
| if [ $? -eq 0 ]; then | ||
| # Prefer Qt 5.5 (QTBUG-53533) | ||
| export PATH=$PATH:$(brew --prefix qt55)/bin | ||
| PATH=$PATH:$(brew --prefix qt55)/bin | ||
| else | ||
| # Fallback Qt 5.6+ | ||
| export PATH=$PATH:$(brew --prefix qt5)/bin | ||
| PATH=$PATH:$(brew --prefix qt5)/bin | ||
| fi | ||
| export PATH | ||
| fi | ||
|
|
||
| # Remove any old .app bundles | ||
| rm -Rf "$APP" | ||
|
|
||
| # Copy/overwrite Info.plist | ||
| \cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/" | ||
| command cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/" | ||
|
|
||
| # Create .app bundle containing contents from CMAKE_INSTALL_PREFIX | ||
| mkdir -p "$APP/Contents/MacOS" | ||
| mkdir -p "$APP/Contents/Frameworks" | ||
| mkdir -p "$APP/Contents/Resources" | ||
| mkdir -p "$APP/Contents/share/stk/rawwaves" | ||
| cd "@CMAKE_INSTALL_PREFIX@" | ||
| cp -R * "$APP/Contents" | ||
| cp -R ./* "$APP/Contents" | ||
| cp "@CMAKE_SOURCE_DIR@/cmake/apple/"*.icns "$APP/Contents/Resources/" | ||
| cp $STK_RAWWAVE/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1 | ||
| cp "$STK_RAWWAVE"/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1 | ||
|
|
||
| # Make all libraries writable for macdeployqt | ||
| cd "$APP" | ||
| find . -type f -print0 | xargs -0 chmod u+w | ||
|
|
@@ -55,11 +59,11 @@ lmmsbin="MacOS/@CMAKE_PROJECT_NAME@" | |
| zynlib="lib/lmms/libzynaddsubfx.so" | ||
| zynfmk="Frameworks/libZynAddSubFxCore.dylib" | ||
| zynbin="MacOS/RemoteZynAddSubFx" | ||
|
|
||
| # Move lmms binary | ||
| mv "$APP/Contents/bin/@CMAKE_PROJECT_NAME@" "$APP/Contents/$lmmsbin" | ||
| # Fix zyn linking | ||
|
|
||
| # Fix zyn linking | ||
| mv "$APP/Contents/lib/lmms/RemoteZynAddSubFx" "$APP/Contents/$zynbin" | ||
| mv "$APP/Contents/lib/lmms/libZynAddSubFxCore.dylib" "$APP/Contents/$zynfmk" | ||
|
|
||
|
|
@@ -70,24 +74,25 @@ install_name_tool -change @rpath/libZynAddSubFxCore.dylib \ | |
| install_name_tool -change @rpath/libZynAddSubFxCore.dylib \ | ||
| @loader_path/../../$zynfmk \ | ||
| "$APP/Contents/$zynlib" | ||
|
|
||
| # Link lmms binary | ||
| _executables="${_executables} -executable=$APP/Contents/$zynbin" | ||
| _executables="${_executables} -executable=$APP/Contents/$zynfmk" | ||
|
|
||
| # Build a list of shared objects in target/lib/lmms | ||
| for file in "$APP/Contents/lib/lmms/"*.so; do | ||
| _thisfile="$APP/Contents/lib/lmms/${file##*/}" | ||
| _executables="${_executables} -executable=$_thisfile" | ||
| done | ||
|
|
||
| # Build a list of shared objects in target/lib/lmms/ladspa | ||
| for file in "$APP/Contents/lib/lmms/ladspa/"*.so; do | ||
| _thisfile="$APP/Contents/lib/lmms/ladspa/${file##*/}" | ||
| _executables="${_executables} -executable=$_thisfile" | ||
| done | ||
|
|
||
| # Finalize .app | ||
| # shellcheck disable=SC2086 | ||
| macdeployqt "$APP" $_executables | ||
|
|
||
| # Cleanup | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You should add
set -eto all scripts exceptafter_script.sh.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.
Done.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'm not sure why I shouldn't add it into
after_script.sh. Ifafter_script.shreturns a non-0 exit code, Travis won't say the build failed. That's exactly the purpose of theafter_scriptin the.ymlfile.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.
It won't hurt in
after_scriptbut to @jasp00's point, theccachestatistics aren't really critical for a pass/fail and it's a single-line, soset -eon the whole script hasn't yet been warranted over something likeexit $?. But @zapashcanon you're right, it's best to add it.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.
Ok, done.
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.
As I see
after_script, it is useful for statistics, non-critical tests, custom notifications (not webhooks), dumps, etc. You probably want to run all of them, soset -eis not convenient. Right now, it does not matter.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.
Could you add
set -etolinux..before_install.sh,linux.win32.before_install.sh,linux.win32.install.sh, etc.?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.
Just did it.