mirror of
https://github.com/BlackMATov/ecs.hpp.git
synced 2025-12-13 02:26:27 +07:00
move to github actions
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
image:
|
|
||||||
- Visual Studio 2017
|
|
||||||
- Visual Studio 2019
|
|
||||||
|
|
||||||
platform:
|
|
||||||
- x86
|
|
||||||
- x64
|
|
||||||
|
|
||||||
configuration:
|
|
||||||
- Release
|
|
||||||
|
|
||||||
for:
|
|
||||||
|
|
||||||
-
|
|
||||||
matrix:
|
|
||||||
only:
|
|
||||||
- platform: x86
|
|
||||||
configuration: Release
|
|
||||||
build_script:
|
|
||||||
- .ci\build_windows_x86.bat
|
|
||||||
|
|
||||||
-
|
|
||||||
matrix:
|
|
||||||
only:
|
|
||||||
- platform: x64
|
|
||||||
configuration: Release
|
|
||||||
build_script:
|
|
||||||
- .ci\build_windows_x64.bat
|
|
||||||
16
.github/workflows/coverage.yml
vendored
Normal file
16
.github/workflows/coverage.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: coverage
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-10.15
|
||||||
|
name: "coverage"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Install lcov by Homebrew
|
||||||
|
run: brew install lcov
|
||||||
|
- name: Build && Test && Upload
|
||||||
|
run: .ci/build_coverage.sh
|
||||||
24
.github/workflows/darwin.yml
vendored
Normal file
24
.github/workflows/darwin.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: darwin
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{matrix.config.os}}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
# https://github.com/actions/virtual-environments/tree/main/images/macos
|
||||||
|
- { os: "macos-10.15", xcode: "10.3" }
|
||||||
|
- { os: "macos-10.15", xcode: "11.7" }
|
||||||
|
- { os: "macos-10.15", xcode: "12.4" }
|
||||||
|
name: "xcode-${{matrix.config.xcode}}"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Select Xcode
|
||||||
|
run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app"
|
||||||
|
- name: Build && Test
|
||||||
|
run: .ci/build_darwin.sh
|
||||||
31
.github/workflows/linux.yml
vendored
Normal file
31
.github/workflows/linux.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: linux
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{matrix.config.os}}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
# https://github.com/actions/virtual-environments/tree/main/images/linux
|
||||||
|
- { os: "ubuntu-20.04", cc: "gcc-7", cxx: "g++-7" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "gcc-8", cxx: "g++-8" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "gcc-9", cxx: "g++-9" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "gcc-10", cxx: "g++-10" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "clang-7", cxx: "clang++-7" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "clang-8", cxx: "clang++-8" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "clang-9", cxx: "clang++-9" }
|
||||||
|
- { os: "ubuntu-20.04", cc: "clang-10", cxx: "clang++-10" }
|
||||||
|
name: "${{matrix.config.cxx}}"
|
||||||
|
steps:
|
||||||
|
- name: Setup
|
||||||
|
run: sudo apt-get -y install "${{matrix.config.cc}}" "${{matrix.config.cxx}}"
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build && Test
|
||||||
|
run: .ci/build_linux.sh
|
||||||
|
env: { CC: "${{matrix.config.cc}}", CXX: "${{matrix.config.cxx}}" }
|
||||||
23
.github/workflows/windows.yml
vendored
Normal file
23
.github/workflows/windows.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: windows
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{matrix.config.os}}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
# https://github.com/actions/virtual-environments/tree/main/images/win
|
||||||
|
- { os: "windows-2016", vs: "Visual Studio 2017", arch: "x86" }
|
||||||
|
- { os: "windows-2016", vs: "Visual Studio 2017", arch: "x64" }
|
||||||
|
- { os: "windows-2019", vs: "Visual Studio 2019", arch: "x86" }
|
||||||
|
- { os: "windows-2019", vs: "Visual Studio 2019", arch: "x64" }
|
||||||
|
name: "${{matrix.config.vs}} ${{matrix.config.arch}}"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Build && Test
|
||||||
|
run: .ci\build_windows_${{matrix.config.arch}}.bat
|
||||||
89
.travis.yml
89
.travis.yml
@@ -1,89 +0,0 @@
|
|||||||
git:
|
|
||||||
depth: false
|
|
||||||
quiet: true
|
|
||||||
|
|
||||||
language: cpp
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
|
|
||||||
#
|
|
||||||
# linux (g++)
|
|
||||||
#
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: bionic
|
|
||||||
stage: linux
|
|
||||||
name: g++-7
|
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7"] } }
|
|
||||||
env: CC=gcc-7 CXX=g++-7
|
|
||||||
script: .ci/build_linux.sh
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: bionic
|
|
||||||
stage: linux
|
|
||||||
name: g++-8
|
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-8"] } }
|
|
||||||
env: CC=gcc-8 CXX=g++-8
|
|
||||||
script: .ci/build_linux.sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# linux (clang++)
|
|
||||||
#
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: bionic
|
|
||||||
stage: linux
|
|
||||||
name: clang++-5.0
|
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-5.0"] } }
|
|
||||||
env: CC=clang-5.0 CXX=clang++-5.0
|
|
||||||
script: .ci/build_linux.sh
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: bionic
|
|
||||||
stage: linux
|
|
||||||
name: clang++-6.0
|
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-6.0"] } }
|
|
||||||
env: CC=clang-6.0 CXX=clang++-6.0
|
|
||||||
script: .ci/build_linux.sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# darwin
|
|
||||||
#
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode10
|
|
||||||
stage: darwin
|
|
||||||
name: xcode10
|
|
||||||
script: .ci/build_darwin.sh
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode11
|
|
||||||
stage: darwin
|
|
||||||
name: xcode11
|
|
||||||
script: .ci/build_darwin.sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# windows
|
|
||||||
#
|
|
||||||
|
|
||||||
- os: windows
|
|
||||||
stage: windows
|
|
||||||
name: x86
|
|
||||||
script: .ci/build_windows_x86.bat
|
|
||||||
|
|
||||||
- os: windows
|
|
||||||
stage: windows
|
|
||||||
name: x64
|
|
||||||
script: .ci/build_windows_x64.bat
|
|
||||||
|
|
||||||
#
|
|
||||||
# coverage
|
|
||||||
#
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode10
|
|
||||||
stage: coverage
|
|
||||||
name: coverage
|
|
||||||
addons: { homebrew: { packages: ["lcov"], update: true } }
|
|
||||||
script: .ci/build_coverage.sh
|
|
||||||
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
|
|||||||
|
|
||||||
if(NOT DEFINED PROJECT_NAME)
|
if(NOT DEFINED PROJECT_NAME)
|
||||||
set(BUILD_AS_STANDALONE ON)
|
set(BUILD_AS_STANDALONE ON)
|
||||||
|
else()
|
||||||
|
set(BUILD_AS_STANDALONE OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(ecs.hpp)
|
project(ecs.hpp)
|
||||||
@@ -11,6 +13,15 @@ add_library(${PROJECT_NAME} INTERFACE)
|
|||||||
target_include_directories(${PROJECT_NAME} INTERFACE headers)
|
target_include_directories(${PROJECT_NAME} INTERFACE headers)
|
||||||
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
|
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
|
||||||
|
|
||||||
|
target_compile_options(${PROJECT_NAME}
|
||||||
|
INTERFACE
|
||||||
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
|
-Wno-c++98-compat-pedantic
|
||||||
|
-Wno-padded
|
||||||
|
-Wno-shadow
|
||||||
|
-Wno-unknown-warning-option
|
||||||
|
-Wno-weak-vtables>)
|
||||||
|
|
||||||
if(BUILD_AS_STANDALONE)
|
if(BUILD_AS_STANDALONE)
|
||||||
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
|
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
|
||||||
if(BUILD_WITH_UNTESTS)
|
if(BUILD_WITH_UNTESTS)
|
||||||
|
|||||||
26
README.md
26
README.md
@@ -2,33 +2,33 @@
|
|||||||
|
|
||||||
> C++17 Entity Component System
|
> C++17 Entity Component System
|
||||||
|
|
||||||
[![travis][badge.travis]][travis]
|
[![linux][badge.linux]][linux]
|
||||||
[![appveyor][badge.appveyor]][appveyor]
|
[![darwin][badge.darwin]][darwin]
|
||||||
|
[![windows][badge.windows]][windows]
|
||||||
[![codecov][badge.codecov]][codecov]
|
[![codecov][badge.codecov]][codecov]
|
||||||
[![language][badge.language]][language]
|
[![language][badge.language]][language]
|
||||||
[![license][badge.license]][license]
|
[![license][badge.license]][license]
|
||||||
[![paypal][badge.paypal]][paypal]
|
|
||||||
|
|
||||||
[badge.travis]: https://img.shields.io/travis/BlackMATov/ecs.hpp/main.svg?logo=travis
|
[badge.darwin]: https://img.shields.io/github/workflow/status/BlackMATov/ecs.hpp/darwin/main?label=Xcode&logo=xcode
|
||||||
[badge.appveyor]: https://img.shields.io/appveyor/ci/BlackMATov/ecs-hpp/main.svg?logo=appveyor
|
[badge.linux]: https://img.shields.io/github/workflow/status/BlackMATov/ecs.hpp/linux/main?label=GCC%2FClang&logo=linux
|
||||||
[badge.codecov]: https://img.shields.io/codecov/c/github/BlackMATov/ecs.hpp/main.svg?logo=codecov
|
[badge.windows]: https://img.shields.io/github/workflow/status/BlackMATov/ecs.hpp/windows/main?label=Visual%20Studio&logo=visual-studio
|
||||||
[badge.language]: https://img.shields.io/badge/language-C%2B%2B17-yellow.svg
|
[badge.codecov]: https://img.shields.io/codecov/c/github/BlackMATov/ecs.hpp/main?logo=codecov
|
||||||
[badge.license]: https://img.shields.io/badge/license-MIT-blue.svg
|
[badge.language]: https://img.shields.io/badge/language-C%2B%2B17-yellow
|
||||||
[badge.paypal]: https://img.shields.io/badge/donate-PayPal-orange.svg?logo=paypal&colorA=00457C
|
[badge.license]: https://img.shields.io/badge/license-MIT-blue
|
||||||
|
|
||||||
[travis]: https://travis-ci.org/BlackMATov/ecs.hpp
|
[darwin]: https://github.com/BlackMATov/ecs.hpp/actions?query=workflow%3Adarwin
|
||||||
[appveyor]: https://ci.appveyor.com/project/BlackMATov/ecs-hpp
|
[linux]: https://github.com/BlackMATov/ecs.hpp/actions?query=workflow%3Alinux
|
||||||
|
[windows]: https://github.com/BlackMATov/ecs.hpp/actions?query=workflow%3Awindows
|
||||||
[codecov]: https://codecov.io/gh/BlackMATov/ecs.hpp
|
[codecov]: https://codecov.io/gh/BlackMATov/ecs.hpp
|
||||||
[language]: https://en.wikipedia.org/wiki/C%2B%2B17
|
[language]: https://en.wikipedia.org/wiki/C%2B%2B17
|
||||||
[license]: https://en.wikipedia.org/wiki/MIT_License
|
[license]: https://en.wikipedia.org/wiki/MIT_License
|
||||||
[paypal]: https://www.paypal.me/matov
|
|
||||||
|
|
||||||
[ecs]: https://github.com/BlackMATov/ecs.hpp
|
[ecs]: https://github.com/BlackMATov/ecs.hpp
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- [gcc](https://www.gnu.org/software/gcc/) **>= 7**
|
- [gcc](https://www.gnu.org/software/gcc/) **>= 7**
|
||||||
- [clang](https://clang.llvm.org/) **>= 5.0**
|
- [clang](https://clang.llvm.org/) **>= 7**
|
||||||
- [msvc](https://visualstudio.microsoft.com/) **>= 2017**
|
- [msvc](https://visualstudio.microsoft.com/) **>= 2017**
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ namespace ecs_hpp::detail
|
|||||||
|
|
||||||
const_iterator find(const T& v) const noexcept {
|
const_iterator find(const T& v) const noexcept {
|
||||||
return has(v)
|
return has(v)
|
||||||
? begin() + sparse_[indexer_(v)]
|
? begin() + static_cast<std::ptrdiff_t>(sparse_[indexer_(v)])
|
||||||
: end();
|
: end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,12 @@ target_link_libraries(${PROJECT_NAME} ecs.hpp)
|
|||||||
target_compile_options(${PROJECT_NAME}
|
target_compile_options(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
/W4>
|
/WX /W4>
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
$<$<CXX_COMPILER_ID:GNU>:
|
||||||
-Wall -Wextra -Wpedantic>)
|
-Werror -Wall -Wextra -Wpedantic>
|
||||||
|
PRIVATE
|
||||||
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
|
-Werror -Weverything -Wconversion>)
|
||||||
|
|
||||||
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
#define STATIC_REQUIRE(...)\
|
#define STATIC_REQUIRE(...)\
|
||||||
static_assert(__VA_ARGS__, #__VA_ARGS__);\
|
static_assert(__VA_ARGS__, #__VA_ARGS__);\
|
||||||
REQUIRE(__VA_ARGS__);
|
REQUIRE(__VA_ARGS__)
|
||||||
|
|
||||||
#define STATIC_REQUIRE_FALSE(...)\
|
#define STATIC_REQUIRE_FALSE(...)\
|
||||||
static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")");\
|
static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")");\
|
||||||
REQUIRE(!(__VA_ARGS__));
|
REQUIRE(!(__VA_ARGS__))
|
||||||
|
|||||||
@@ -298,14 +298,14 @@ TEST_CASE("detail") {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sparse_map<unsigned, obj_t> m;
|
sparse_map<unsigned, obj_t> m;
|
||||||
REQUIRE(m.insert_or_assign(42, obj_t(42)).second);
|
REQUIRE(m.insert_or_assign(42u, obj_t(42)).second);
|
||||||
REQUIRE(m.has(42));
|
REQUIRE(m.has(42));
|
||||||
REQUIRE(m.get(42).x == 42);
|
REQUIRE(m.get(42).x == 42);
|
||||||
REQUIRE_FALSE(m.insert_or_assign(42, obj_t(21)).second);
|
REQUIRE_FALSE(m.insert_or_assign(42u, obj_t(21)).second);
|
||||||
REQUIRE(m.has(42));
|
REQUIRE(m.has(42));
|
||||||
REQUIRE(m.get(42).x == 21);
|
REQUIRE(m.get(42).x == 21);
|
||||||
REQUIRE(m.size() == 1);
|
REQUIRE(m.size() == 1);
|
||||||
REQUIRE(m.insert_or_assign(84, obj_t(84)).second);
|
REQUIRE(m.insert_or_assign(84u, obj_t(84)).second);
|
||||||
REQUIRE(m.has(84));
|
REQUIRE(m.has(84));
|
||||||
REQUIRE(m.get(84).x == 84);
|
REQUIRE(m.get(84).x == 84);
|
||||||
REQUIRE(m.size() == 2);
|
REQUIRE(m.size() == 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user