1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

Merge mostly fixing CI builds

This commit is contained in:
tsjost 2021-10-12 18:41:52 +02:00
commit 115ff7ff74
10 changed files with 49 additions and 77 deletions

View File

@ -10,7 +10,7 @@ matrix:
- scripts/docker/docker_travis.sh "ubuntu_latest.docker"
- os: linux
compiler: clang
env: NAME="Fedora Linux (Latest)" NAME_SUFFIX="fedora-llvm" TEST_COVERAGE=1
env: NAME="Fedora Linux (Latest)" NAME_SUFFIX="fedora-llvm"
services: docker
script:
- scripts/docker/docker_travis.sh "fedora_latest.docker"
@ -20,25 +20,25 @@ matrix:
services: docker
script:
- scripts/docker/docker_travis.sh "arch_latest.docker"
- os: linux
compiler: gcc
env: NAME="conan" NAME_SUFFIX="conan" USE_CONAN=1
script:
- scripts/docker/docker_travis.sh "conan_base.docker"
- os: osx
compiler: clang
env: NAME="Apple macOS" NAME_SUFFIX="mac"
osx_image: xcode10.1
install:
- brew update
- /usr/bin/yes | pip2 uninstall numpy # see https://github.com/travis-ci/travis-ci/issues/6688
- brew upgrade python
- brew upgrade
- brew install boost cmake bullet ffmpeg glm openal-soft qt5 sdl2 jack freetype
- export PATH="/usr/local/opt/qt/bin:$PATH"
script:
- mkdir -p "$TRAVIS_BUILD_DIR/build"
- ctest -VV -S "$TRAVIS_BUILD_DIR/cmake/ctest/script_ci.ctest"
# - os: linux
# compiler: gcc
# env: NAME="conan" NAME_SUFFIX="conan" USE_CONAN=1
# script:
# - scripts/docker/docker_travis.sh "conan_base.docker"
# - os: osx
# compiler: clang
# env: NAME="Apple macOS" NAME_SUFFIX="mac"
# osx_image: xcode10.1
# install:
# - brew update
# - /usr/bin/yes | pip2 uninstall numpy # see https://github.com/travis-ci/travis-ci/issues/6688
# - brew upgrade python
# - brew upgrade
# - brew install boost cmake bullet ffmpeg glm openal-soft qt5 sdl2 jack freetype
# - export PATH="/usr/local/opt/qt/bin:$PATH"
# script:
# - mkdir -p "$TRAVIS_BUILD_DIR/build"
# - ctest -VV -S "$TRAVIS_BUILD_DIR/cmake/ctest/script_ci.ctest"
notifications:
email: false

View File

@ -29,9 +29,6 @@ if(USE_CONAN)
else()
find_package(Boost REQUIRED)
find_package(Boost COMPONENTS program_options system REQUIRED)
if(FILESYSTEM_LIBRARY STREQUAL "BOOST")
find_package(Boost COMPONENTS filesystem system REQUIRED)
endif()
if(BUILD_TESTS)
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
endif()

View File

@ -12,7 +12,7 @@ this it will not be possible to play.
Windows | Linux | macOS | coverage
---| --- | --- | ---
[![Build status](https://ci.appveyor.com/api/projects/status/k33qf9ssrja6ckx8/branch/master?svg=true)](https://ci.appveyor.com/project/rwengine/openrw/branch/master) | [![Build Status](https://travis-ci.com/rwengine/openrw.svg?branch=master)](https://travis-ci.com/rwengine/openrw) | [![Build Status](https://travis-ci.com/rwengine/openrw.svg?branch=master)](https://travis-ci.com/rwengine/openrw) | [![codecov](https://codecov.io/gh/rwengine/openrw/branch/master/graph/badge.svg)](https://codecov.io/gh/rwengine/openrw)
[![Build status](https://ci.appveyor.com/api/projects/status/k33qf9ssrja6ckx8/branch/master?svg=true)](https://ci.appveyor.com/project/rwengine/openrw/branch/master) | [![Build Status](https://app.travis-ci.com/rwengine/openrw.svg?branch=master)](https://app.travis-ci.com/rwengine/openrw) | [disabled](https://github.com/rwengine/openrw/commit/f8483d190588a159f65c1c3ffb153e20888347b8) | [![codecov](https://codecov.io/gh/rwengine/openrw/branch/master/graph/badge.svg)](https://codecov.io/gh/rwengine/openrw)
## Links

View File

@ -126,11 +126,6 @@ elseif(FILESYSTEM_LIBRARY STREQUAL "CXXTS")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_link_libraries(rw_interface INTERFACE "stdc++fs")
endif()
elseif(FILESYSTEM_LIBRARY STREQUAL "BOOST")
target_compile_definitions(rw_interface INTERFACE "RW_FS_LIBRARY=2")
target_link_libraries(rw_interface INTERFACE
Boost::filesystem
)
else()
message(FATAL_ERROR "Illegal FILESYSTEM_LIBRARY option. (was '${FILESYSTEM_LIBRARY}')")
endif()

View File

@ -12,8 +12,8 @@ option(TEST_DATA "Enable tests that require game data")
set(FAILED_CHECK_ACTION "IGNORE" CACHE STRING "What action to perform on a failed RW_CHECK (in debug mode)")
set_property(CACHE FAILED_CHECK_ACTION PROPERTY STRINGS "IGNORE" "ABORT" "BREAKPOINT")
set(FILESYSTEM_LIBRARY "BOOST" CACHE STRING "Which filesystem library to use")
set_property(CACHE FILESYSTEM_LIBRARY PROPERTY STRINGS "CXX17" "CXXTS" "BOOST")
set(FILESYSTEM_LIBRARY "CXX17" CACHE STRING "Which filesystem library to use")
set_property(CACHE FILESYSTEM_LIBRARY PROPERTY STRINGS "CXX17" "CXXTS")
set(CMAKE_CONFIGURATION_TYPES "Release;Debug;RelWithDebInfo;MinSizeRel" CACHE INTERNAL "Build types supported by this project.")
if(NOT CMAKE_BUILD_TYPE)

View File

@ -3,7 +3,6 @@
#define RW_FS_CXX17 0
#define RW_FS_CXXTS 1
#define RW_FS_BOOST 2
#if RW_FS_LIBRARY == RW_FS_CXX17
#include <filesystem>
@ -19,33 +18,6 @@ namespace rwfs {
using namespace std::experimental::filesystem;
using error_code = std::error_code;
}
#elif RW_FS_LIBRARY == RW_FS_BOOST
#include <boost/filesystem.hpp>
#include <boost/functional/hash.hpp>
#include <boost/system/error_code.hpp>
namespace rwfs {
using namespace boost::filesystem;
using error_code = boost::system::error_code;
}
#include <boost/version.hpp>
#if BOOST_VERSION < 105600
namespace boost {
namespace filesystem {
inline const directory_iterator& begin(const directory_iterator& iter) {
return iter;
}
inline directory_iterator end(const directory_iterator&) {
return {};
}
inline const recursive_directory_iterator& begin(const recursive_directory_iterator& iter) {
return iter;
}
inline recursive_directory_iterator end(const recursive_directory_iterator&) {
return {};
}
}
}
#endif
#else
#error Invalid RW_FS_LIBRARY value
#endif

View File

@ -1,4 +1,12 @@
FROM archlinux/base
FROM archlinux:base
# Work-around the issue with glibc 2.33 on old Docker engines
# Extract files directly as pacman is also affected by the issue
# https://github.com/lxqt/lxqt-panel/pull/1562 and
# https://github.com/actions/virtual-environments/issues/2658
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \
curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \
bsdtar -C / -xf $patched_glibc
RUN pacman -Syy --noconfirm \
core/gcc \

View File

@ -22,7 +22,7 @@ RUN dnf update -y \
glm-devel \
openal-soft-devel \
SDL2-devel \
qt5-devel \
qt5-qtbase-devel \
freetype-devel \
libasan \
&& ln -s /usr/bin/python3 /usr/bin/python

View File

@ -1,13 +1,15 @@
FROM ubuntu:rolling
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install --no-install-recommends --no-upgrade -y \
build-essential \
cmake \
ninja-build \
gcc-7 \
g++-7 \
clang-6.0 \
gcc \
g++ \
clang \
llvm \
lcov \
curl \
@ -23,10 +25,6 @@ RUN apt-get update \
libqt5opengl5-dev \
libfreetype6-dev \
iwyu \
qt5-default \
&& apt-get clean \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 60
qt5-default
CMD ["/bin/bash"]

View File

@ -7,6 +7,7 @@
#include <fstream>
#include <map>
#include <chrono>
#include <rw/debug.hpp>
#include <rw/filesystem.hpp>
@ -92,7 +93,8 @@ protected:
private:
static rwfs::path getRandomFilePath(const rwfs::path &dirname) {
return rwfs::unique_path(dirname / "openrw_test_%%%%%%%%%%%%%%%%");
const long current_time = std::chrono::high_resolution_clock::now().time_since_epoch().count();
return dirname / ("openrw_test_" + std::to_string(current_time));
}
static rwfs::path getRandomFilePath() {
return getRandomFilePath(rwfs::temp_directory_path());
@ -113,15 +115,15 @@ public:
}
virtual void change_perms_normal() const override {
rwfs::permissions(this->path(),
rwfs::perms::owner_read | rwfs::perms::owner_write | rwfs::perms::owner_exe |
rwfs::perms::group_read | rwfs::perms::group_exe |
rwfs::perms::others_read | rwfs::perms::others_exe);
rwfs::perms::owner_read | rwfs::perms::owner_write | rwfs::perms::owner_exec |
rwfs::perms::group_read | rwfs::perms::group_exec |
rwfs::perms::others_read | rwfs::perms::others_exec);
}
virtual void change_perms_readonly() const override {
rwfs::permissions(this->path(),
rwfs::perms::owner_read | rwfs::perms::owner_exe |
rwfs::perms::group_read | rwfs::perms::group_exe |
rwfs::perms::others_read | rwfs::perms::others_exe);
rwfs::perms::owner_read | rwfs::perms::owner_exec |
rwfs::perms::group_read | rwfs::perms::group_exec |
rwfs::perms::others_read | rwfs::perms::others_exec);
}
virtual void remove() const override {
// Remove may fail if this directory contains a read-only entry. Ignore.