Merge pull request #982 from asuessenbach/actions

Use github actions for CI builds.
This commit is contained in:
Andreas Süßenbach 2021-06-17 17:08:20 +02:00 committed by GitHub
commit f6b2c8e055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 171 additions and 470 deletions

View File

@ -1,76 +0,0 @@
build:
verbosity: detailed
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_TYPE: Debug
GENERATOR_ARCH: Win32
PYTHON: "C:\\Python38"
CXX_STANDARD: 11
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_TYPE: Debug
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 11
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_TYPE: Debug
GENERATOR_ARCH: Win32
PYTHON: "C:\\Python38"
CXX_STANDARD: 11
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_TYPE: Debug
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 11
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Debug
GENERATOR_ARCH: Win32
PYTHON: "C:\\Python38"
CXX_STANDARD: 11
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Debug
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 11
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Debug
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 14
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Debug
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 17
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Debug
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 20
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: Release
GENERATOR_ARCH: x64
PYTHON: "C:\\Python38-x64"
CXX_STANDARD: 20
install:
- git submodule update --init --recursive
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
build_script:
- mkdir build
- cd build
- cmake --version
- cmake ..
-A %GENERATOR_ARCH%
-DSAMPLES_BUILD=ON
-DTESTS_BUILD=ON
-DSAMPLES_BUILD_ONLY_DYNAMIC=ON
-DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DTESTS_BUILD_ONLY_DYNAMIC=ON
-DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DVULKAN_HPP_RUN_GENERATOR=ON
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_CXX_STANDARD=%CXX_STANDARD%
- cmake --build . --config %BUILD_TYPE%

40
.github/workflows/ci-ubuntu.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: CI Ubuntu
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
cxx_compiler: [g++-9, g++-10, clang++-10, clang++-11, clang++-12]
cxx_standard: [11, 14, 17, 20]
steps:
- uses: actions/checkout@v2
- name: Install libraries
run: sudo apt install libgl-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev
- name: Update Submodules
run: git submodule update --init --recursive
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build
-DSAMPLES_BUILD=ON
-DSAMPLES_BUILD_ONLY_DYNAMIC=ON
-DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DTESTS_BUILD=ON
-DTESTS_BUILD_ONLY_DYNAMIC=ON
-DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DVULKAN_HPP_RUN_GENERATOR=ON
-DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}}
-DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}

37
.github/workflows/ci-windows.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: CI Windows
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest, windows-2016]
architecture: [Win32, x64]
build_type: [Debug, Release]
cxx_standard: [11, 14, 17, 20]
steps:
- uses: actions/checkout@v2
- name: Update Submodules
run: git submodule update --init --recursive
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build
-A ${{matrix.architecture}}
-DSAMPLES_BUILD=ON
-DSAMPLES_BUILD_ONLY_DYNAMIC=ON
-DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DTESTS_BUILD=ON
-DTESTS_BUILD_ONLY_DYNAMIC=ON
-DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DVULKAN_HPP_RUN_GENERATOR=ON
-DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}

View File

@ -1,350 +0,0 @@
# Build Configuration for Travis CI
# https://travis-ci.org
dist: bionic
language: cpp
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- ADDITIONAL_BUILD_OPTIONS="-DSAMPLES_BUILD=OFF"
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: g++-5
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: g++-6
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: g++-7
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: g++-8
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: g++-9
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-10
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-10 && CXX=g++-10"
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: g++-10
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-10
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- MATRIX_EVAL="CC=gcc-10 && CXX=g++-10"
- BUILD_TYPE="Release"
- CXX_STANDARD="11"
compiler: g++-10
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-4.0
- CC=clang-4.0 && CXX=clang++-4.0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-4.0
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-5.0
- CC=clang-5.0 && CXX=clang++-5.0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-5.0
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-6.0
- CC=clang-6.0 && CXX=clang++-6.0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-6.0
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-7
- CC=clang-7 && CXX=clang++-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-7
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-8
- CC=clang-8 && CXX=clang++-8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-8
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-9
- CC=clang-9 && CXX=clang++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-9
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-10
- CC=clang-10 && CXX=clang++-10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="11"
compiler: clang++-10
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-10
- CC=clang-10 && CXX=clang++-10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="14"
compiler: clang++-10
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-10
- CC=clang-10 && CXX=clang++-10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="17"
compiler: clang++-10
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-10
- CC=clang-10 && CXX=clang++-10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Debug"
- CXX_STANDARD="20"
compiler: clang++-10
- os: linux
before_install:
- sudo apt-get update
- sudo apt-get purge g++
- sudo apt-get install clang-10
- CC=clang-10 && CXX=clang++-10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- ninja-build
- xorg-dev
- libglu1-mesa-dev
env:
- BUILD_TYPE="Release"
- CXX_STANDARD="20"
compiler: clang++-10
before_install:
- eval "${MATRIX_EVAL}"
script:
- mkdir build
- cd build
- cmake --version
- cmake -GNinja ..
-DSAMPLES_BUILD=ON
-DTESTS_BUILD=ON
-DSAMPLES_BUILD_ONLY_DYNAMIC=ON
-DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DTESTS_BUILD_ONLY_DYNAMIC=ON
-DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_CXX_FLAGS="-Wall -Wpedantic -Wextra"
-DCMAKE_CXX_STANDARD=$CXX_STANDARD
$ADDITIONAL_BUILD_OPTIONS
- cmake --build .
- ./VulkanHppGenerator

View File

@ -18,12 +18,25 @@
#if defined( _MSC_VER )
# pragma warning( push )
# pragma warning( disable : 4127 ) // conditional expression is constant (glm)
#elif defined( __clang__ )
// no need to ignore any warnings with clang
#elif defined( __GNUC__ )
# if ( 10 <= __GNUC__ ) && ( 201703L < __cplusplus )
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wvolatile"
# endif
#endif
#include <glm/glm.hpp>
#if defined( _MSC_VER )
# pragma warning( pop )
#elif defined( __clang__ )
// no need to ignore any warnings with clang
#elif defined( __GNUC__ )
# if ( 10 <= __GNUC__ ) && ( 201703L < __cplusplus )
# pragma GCC diagnostic pop
# endif
#endif
#include <vulkan/vulkan.hpp>

View File

@ -18,12 +18,25 @@
#if defined( _MSC_VER )
# pragma warning( push )
# pragma warning( disable : 4127 ) // conditional expression is constant (glm)
#elif defined( __clang__ )
// no need to ignore any warnings with clang
#elif defined( __GNUC__ )
# if ( 10 <= __GNUC__ ) && ( 201703L < __cplusplus )
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wvolatile"
# endif
#endif
#include <glm/glm.hpp>
#if defined( _MSC_VER )
# pragma warning( pop )
#elif defined( __clang__ )
// no need to ignore any warnings with clang
#elif defined( __GNUC__ )
# if ( 10 <= __GNUC__ ) && ( 201703L < __cplusplus )
# pragma GCC diagnostic pop
# endif
#endif
#include <vulkan/vulkan.hpp>
@ -34,56 +47,80 @@ namespace vk
{
class CameraManipulator
{
public:
enum class Action { None, Orbit, Dolly, Pan, LookAround };
enum class Mode { Examine, Fly, Walk, Trackball };
enum class MouseButton { None, Left, Middle, Right };
enum class ModifierFlagBits : uint32_t { Shift = 1, Ctrl = 2, Alt = 4 };
using ModifierFlags = vk::Flags<ModifierFlagBits>;
public:
enum class Action
{
None,
Orbit,
Dolly,
Pan,
LookAround
};
enum class Mode
{
Examine,
Fly,
Walk,
Trackball
};
enum class MouseButton
{
None,
Left,
Middle,
Right
};
enum class ModifierFlagBits : uint32_t
{
Shift = 1,
Ctrl = 2,
Alt = 4
};
using ModifierFlags = vk::Flags<ModifierFlagBits>;
public:
CameraManipulator();
public:
CameraManipulator();
glm::vec3 const& getCameraPosition() const;
glm::vec3 const& getCenterPosition() const;
glm::mat4 const& getMatrix() const;
Mode getMode() const;
glm::ivec2 const& getMousePosition() const;
float getRoll() const;
float getSpeed() const;
glm::vec3 const& getUpVector() const;
glm::u32vec2 const& getWindowSize() const;
Action mouseMove(glm::ivec2 const& position, MouseButton mouseButton, ModifierFlags & modifiers);
void setLookat(const glm::vec3& cameraPosition, const glm::vec3& centerPosition, const glm::vec3& upVector);
void setMode(Mode mode);
void setMousePosition(glm::ivec2 const& position);
void setRoll(float roll); // roll in radians
void setSpeed(float speed);
void setWindowSize(glm::ivec2 const& size);
void wheel(int value);
glm::vec3 const & getCameraPosition() const;
glm::vec3 const & getCenterPosition() const;
glm::mat4 const & getMatrix() const;
Mode getMode() const;
glm::ivec2 const & getMousePosition() const;
float getRoll() const;
float getSpeed() const;
glm::vec3 const & getUpVector() const;
glm::u32vec2 const & getWindowSize() const;
Action mouseMove( glm::ivec2 const & position, MouseButton mouseButton, ModifierFlags & modifiers );
void setLookat( const glm::vec3 & cameraPosition, const glm::vec3 & centerPosition, const glm::vec3 & upVector );
void setMode( Mode mode );
void setMousePosition( glm::ivec2 const & position );
void setRoll( float roll ); // roll in radians
void setSpeed( float speed );
void setWindowSize( glm::ivec2 const & size );
void wheel( int value );
private:
void dolly(glm::vec2 const& delta);
void motion(glm::ivec2 const& position, Action action = Action::None);
void orbit(glm::vec2 const& delta, bool invert = false);
void pan(glm::vec2 const& delta);
double projectOntoTBSphere(const glm::vec2& p);
void trackball(glm::ivec2 const& position);
void update();
private:
void dolly( glm::vec2 const & delta );
void motion( glm::ivec2 const & position, Action action = Action::None );
void orbit( glm::vec2 const & delta, bool invert = false );
void pan( glm::vec2 const & delta );
double projectOntoTBSphere( const glm::vec2 & p );
void trackball( glm::ivec2 const & position );
void update();
private:
glm::vec3 m_cameraPosition = glm::vec3(10, 10, 10);
glm::vec3 m_centerPosition = glm::vec3(0, 0, 0);
glm::vec3 m_upVector = glm::vec3(0, 1, 0);
float m_roll = 0; // Rotation around the Z axis in RAD
glm::mat4 m_matrix = glm::mat4(1);
private:
glm::vec3 m_cameraPosition = glm::vec3( 10, 10, 10 );
glm::vec3 m_centerPosition = glm::vec3( 0, 0, 0 );
glm::vec3 m_upVector = glm::vec3( 0, 1, 0 );
float m_roll = 0; // Rotation around the Z axis in RAD
glm::mat4 m_matrix = glm::mat4( 1 );
glm::u32vec2 m_windowSize = glm::u32vec2(1, 1);
glm::u32vec2 m_windowSize = glm::u32vec2( 1, 1 );
float m_speed = 30.0f;
glm::ivec2 m_mousePosition = glm::ivec2(0, 0);
float m_speed = 30.0f;
glm::ivec2 m_mousePosition = glm::ivec2( 0, 0 );
Mode m_mode = Mode::Examine;
Mode m_mode = Mode::Examine;
};
} // namespace su
} // namespace su
} // namespace vk