From 5443bb927e55b33d2a80ddbb24dcb85a38f548e2 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Fri, 20 Nov 2020 15:00:06 -0500 Subject: [PATCH] Add github action build step. --- .github/workflows/build-ci.yml | 79 ++++++++++++++++++++++++++++++++++ scripts/build-travis.sh | 5 ++- src/Input.cpp | 8 ++-- src/Input.h | 8 ++-- src/InputBindings.h | 2 +- src/Pi.cpp | 2 + 6 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build-ci.yml diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml new file mode 100644 index 00000000000..65c96b6095d --- /dev/null +++ b/.github/workflows/build-ci.yml @@ -0,0 +1,79 @@ +# Test all pull requests to ensure they build + +name: Build Pioneer + +# Controls when the action will run. +on: + pull_request: + paths: + - 'src/**.cpp' + - 'src/**.h' + +env: + packages: > + mesa-common-dev + libfreeimage-dev + libglew-dev + libsigc++-2.0-dev + libvorbis-dev + libassimp-dev + libsdl2-dev + libsdl2-image-dev + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build-gcc: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-16.04] + + steps: + # Checkout the repository as $GITHUB_WORKSPACE + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: | + sudo apt-fast install -y ${{ env.packages }} + + - name: Build GCC + run: ./bootstrap cmake && make -C build + + - name: Build Pioneer Data + run: make -C build build-data + + - name: Build Release + run: ./scripts/build-travis.sh + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: Linux-Artifacts + path: release/zip/*.tar.gz + + build-clang: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-16.04] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + # Checkout the repository as $GITHUB_WORKSPACE + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: | + sudo apt-fast install -y clang-8 ${{ env.packages }} + + - name: Build Clang + run: | + export CC=clang CXX=clang++ + ./bootstrap cmake && make -C build + + - name: Build Pioneer Data + run: make -C build build-data + + - name: Build Release + run: ./scripts/build-travis.sh diff --git a/scripts/build-travis.sh b/scripts/build-travis.sh index 9a9777e32cf..74a9b6f438d 100755 --- a/scripts/build-travis.sh +++ b/scripts/build-travis.sh @@ -54,10 +54,11 @@ mkdir -p release/zip echo "Bundling output..." +TAG_NAME=$(git describe HEAD) if [ "$BUILD_TYPE" == "mxe" ]; then - zip -r "release/zip/pioneer-$TRAVIS_TAG-mxe.zip" release/* -x *release/zip* + zip -r "release/zip/pioneer-$TAG_NAME-mxe.zip" release/* -x *release/zip* else - tar -czf "release/zip/pioneer-$TRAVIS_TAG.tar.gz" --exclude=release/zip release/* + tar -czf "release/zip/pioneer-$TAG_NAME.tar.gz" --exclude=release/zip release/* fi echo "Release finished successfully!" diff --git a/src/Input.cpp b/src/Input.cpp index 1c8a8859c18..4d3c056e5fd 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -19,16 +19,16 @@ using namespace Input; namespace Input { - std::vector> *m_registrations; + std::vector> *m_registrations; - std::vector> &GetBindingRegistration() + std::vector> &GetBindingRegistration() { return *m_registrations; } - bool AddBindingRegistrar(sigc::slot &&fn) + bool AddBindingRegistrar(sigc::slot &&fn) { - static std::vector> registrations; + static std::vector> registrations; m_registrations = ®istrations; registrations.push_back(fn); diff --git a/src/Input.h b/src/Input.h index 5568597a448..b42c670d5f0 100644 --- a/src/Input.h +++ b/src/Input.h @@ -63,10 +63,10 @@ namespace Input { virtual void RegisterBindings(){}; // Called when the frame is added to the stack. - sigc::signal onFrameAdded; + sigc::signal onFrameAdded; // Called when the frame is removed from the stack. - sigc::signal onFrameRemoved; + sigc::signal onFrameRemoved; Action *AddAction(std::string id); Axis *AddAxis(std::string id); @@ -111,8 +111,8 @@ namespace Input { // The functions registered via AddBindingRegistrar should be thread-safe and // should not depend on anything but the manager object being passed in. // The registrars are guaranteed to be called after static initialization has finished. - std::vector> &GetBindingRegistration(); - bool AddBindingRegistrar(sigc::slot &&fn); + std::vector> &GetBindingRegistration(); + bool AddBindingRegistrar(sigc::slot &&fn); } // namespace Input class Input::Manager { diff --git a/src/InputBindings.h b/src/InputBindings.h index 42c8cba9307..61083df7410 100644 --- a/src/InputBindings.h +++ b/src/InputBindings.h @@ -192,7 +192,7 @@ namespace InputBindings { float m_value; - sigc::signal onAxisValue; + sigc::signal onAxisValue; // serialization friend nonstd::string_view &operator>>(nonstd::string_view &, Axis &); diff --git a/src/Pi.cpp b/src/Pi.cpp index fceb44eeba5..8be0d216b71 100644 --- a/src/Pi.cpp +++ b/src/Pi.cpp @@ -1295,6 +1295,7 @@ static void SetVideoRecording(bool enabled) } #endif +#if 0 void printShipStats() { // test code to produce list of ship stats @@ -1338,3 +1339,4 @@ void printShipStats() fclose(pStatFile); } } +#endif