Skip to content

Commit

Permalink
Add github action build step.
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Nov 20, 2020
1 parent 0b7861f commit 5443bb9
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 11 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions scripts/build-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down
8 changes: 4 additions & 4 deletions src/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
using namespace Input;

namespace Input {
std::vector<sigc::slot<void(Input::Manager *)>> *m_registrations;
std::vector<sigc::slot<void, Input::Manager *>> *m_registrations;

std::vector<sigc::slot<void(Input::Manager *)>> &GetBindingRegistration()
std::vector<sigc::slot<void, Input::Manager *>> &GetBindingRegistration()
{
return *m_registrations;
}

bool AddBindingRegistrar(sigc::slot<void(Input::Manager *)> &&fn)
bool AddBindingRegistrar(sigc::slot<void, Input::Manager *> &&fn)
{
static std::vector<sigc::slot<void(Input::Manager *)>> registrations;
static std::vector<sigc::slot<void, Input::Manager *>> registrations;
m_registrations = &registrations;

registrations.push_back(fn);
Expand Down
8 changes: 4 additions & 4 deletions src/Input.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ namespace Input {
virtual void RegisterBindings(){};

// Called when the frame is added to the stack.
sigc::signal<void(InputFrame *)> onFrameAdded;
sigc::signal<void, InputFrame *> onFrameAdded;

// Called when the frame is removed from the stack.
sigc::signal<void(InputFrame *)> onFrameRemoved;
sigc::signal<void, InputFrame *> onFrameRemoved;

Action *AddAction(std::string id);
Axis *AddAxis(std::string id);
Expand Down Expand Up @@ -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<sigc::slot<void(Input::Manager *)>> &GetBindingRegistration();
bool AddBindingRegistrar(sigc::slot<void(Input::Manager *)> &&fn);
std::vector<sigc::slot<void, Input::Manager *>> &GetBindingRegistration();
bool AddBindingRegistrar(sigc::slot<void, Input::Manager *> &&fn);
} // namespace Input

class Input::Manager {
Expand Down
2 changes: 1 addition & 1 deletion src/InputBindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ namespace InputBindings {

float m_value;

sigc::signal<void(float)> onAxisValue;
sigc::signal<void, float> onAxisValue;

// serialization
friend nonstd::string_view &operator>>(nonstd::string_view &, Axis &);
Expand Down
2 changes: 2 additions & 0 deletions src/Pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ static void SetVideoRecording(bool enabled)
}
#endif

#if 0
void printShipStats()
{
// test code to produce list of ship stats
Expand Down Expand Up @@ -1338,3 +1339,4 @@ void printShipStats()
fclose(pStatFile);
}
}
#endif

0 comments on commit 5443bb9

Please sign in to comment.