From dfac2e98e9439b3e5e404d7ffe3a06ed1f30013b Mon Sep 17 00:00:00 2001 From: asarium Date: Sat, 23 Feb 2019 15:50:46 +0100 Subject: [PATCH] Add CircleCI config file --- .circleci/config.yml | 182 +++++++++++++++++++++++++++ code/cutscene/cutscenes.h | 8 -- code/gamesnd/gamesnd.h | 2 +- code/pilotfile/csg_convert.cpp | 2 +- code/pilotfile/pilotfile_convert.cpp | 2 +- code/pilotfile/pilotfile_convert.h | 34 +++-- 6 files changed, 201 insertions(+), 29 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..ea2604c8a2 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,182 @@ +version: 2 + +references: + container_config: &container_config + docker: + - image: "debian:stretch" + working_directory: /root/build + + restore_repo: &restore_repo + restore_cache: + keys: + - source-repo-{{ .Branch }}-{{ .Revision }} + - source-repo-{{ .Branch }} + - source-repo + + cmake_configure: &cmake_configure + run: + name: Creating Build Files + command: | + mkdir build + cd build + + CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas" + CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas" + + if [[ "$CC" =~ ^clang.*$ ]]; then + CXXFLAGS="$CXXFLAGS -stdlib=libc++" + fi + + eval $CC --version + + export CXXFLAGS + export CFLAGS + CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS" + eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON .. + + compile: &compile + run: + name: Compiling Source code + command: | + cd build + ninja -k 20 all + + run_tests: &run_tests + run: + name: Run unit tests + command: | + ./build/bin/unittests --gtest_shuffle + + compile_steps: &compile_steps + steps: + - *restore_repo + - *cmake_configure + - *compile + - *run_tests +jobs: + checkout_code: + <<: *container_config + steps: + - run: + name: Installing Git + command: 'apt-get update && apt-get -yq install git' + - *restore_repo + - checkout + - run: + name: Updating submodules + command: 'git submodule update --init --recursive' + - save_cache: + key: source-repo-{{ .Branch }}-{{ .Revision }} + paths: + - . + + build_gcc_lowest_debug: + docker: + - image: asarium/fso_compile:gcc-lowest + working_directory: /root/build + environment: + CC: gcc + CXX: g++ + CONFIGURATION: Debug + <<: *compile_steps + + build_gcc_lowest_release: + docker: + - image: asarium/fso_compile:gcc-lowest + working_directory: /root/build + environment: + CC: gcc + CXX: g++ + CONFIGURATION: Release + <<: *compile_steps + + build_gcc_latest_debug: + docker: + - image: asarium/fso_compile:gcc-latest + working_directory: /root/build + environment: + CC: gcc + CXX: g++ + CONFIGURATION: Debug + <<: *compile_steps + + build_gcc_latest_release: + docker: + - image: asarium/fso_compile:gcc-latest + working_directory: /root/build + environment: + CC: gcc + CXX: g++ + CONFIGURATION: Release + <<: *compile_steps + + build_clang_latest_debug: + docker: + - image: asarium/fso_compile:clang-latest + working_directory: /root/build + environment: + CC: clang-8 + CXX: clang++-8 + CONFIGURATION: Debug + <<: *compile_steps + + build_clang_latest_release: + docker: + - image: asarium/fso_compile:clang-latest + working_directory: /root/build + environment: + CC: clang-8 + CXX: clang++-8 + CONFIGURATION: Release + <<: *compile_steps + + build_clang_lowest_debug: + docker: + - image: asarium/fso_compile:clang-lowest + working_directory: /root/build + environment: + CC: clang + CXX: clang++ + CONFIGURATION: Debug + <<: *compile_steps + + build_clang_lowest_release: + docker: + - image: asarium/fso_compile:clang-lowest + working_directory: /root/build + environment: + CC: clang + CXX: clang++ + CONFIGURATION: Release + <<: *compile_steps + +workflows: + version: 2 + + build_test: + jobs: + - checkout_code + - build_gcc_lowest_debug: + requires: + - checkout_code + - build_gcc_lowest_release: + requires: + - checkout_code + - build_gcc_latest_debug: + requires: + - checkout_code + - build_gcc_latest_release: + requires: + - checkout_code + - build_clang_latest_debug: + requires: + - checkout_code + - build_clang_latest_release: + requires: + - checkout_code + - build_clang_lowest_debug: + requires: + - checkout_code + - build_clang_lowest_release: + requires: + - checkout_code \ No newline at end of file diff --git a/code/cutscene/cutscenes.h b/code/cutscene/cutscenes.h index 516c5f20f1..d3a79ddb40 100644 --- a/code/cutscene/cutscenes.h +++ b/code/cutscene/cutscenes.h @@ -21,15 +21,7 @@ typedef struct cutscene_info bool viewable; } cutscene_info; -#if SCP_COMPILER_IS_GNU -#pragma GCC diagnostic push -// This suppresses a GCC bug where it thinks that the Cutscenes from the enum class below shadows a global variable -#pragma GCC diagnostic ignored "-Wshadow" -#endif extern SCP_vector Cutscenes; -#if SCP_COMPILER_IS_GNU -#pragma GCC diagnostic pop -#endif // initializa table data void cutscene_init(); diff --git a/code/gamesnd/gamesnd.h b/code/gamesnd/gamesnd.h index 729f11ad9a..e14b086f90 100644 --- a/code/gamesnd/gamesnd.h +++ b/code/gamesnd/gamesnd.h @@ -246,7 +246,7 @@ enum class GameSounds { /** * Interface sounds */ -enum InterfaceSounds { +enum class InterfaceSounds { IFACE_MOUSE_CLICK =0, //!< mouse click ICON_PICKUP =1, //!< pick up a ship icon (Empty in Retail) ICON_DROP_ON_WING =2, //!< drop a ship icon on a wing slot diff --git a/code/pilotfile/csg_convert.cpp b/code/pilotfile/csg_convert.cpp index d8d5f1a5e4..964fa133b8 100644 --- a/code/pilotfile/csg_convert.cpp +++ b/code/pilotfile/csg_convert.cpp @@ -7,9 +7,9 @@ */ #include "cfile/cfilesystem.h" +#include "pilotfile/pilotfile_convert.h" #include "cutscene/cutscenes.h" #include "menuui/techmenu.h" -#include "pilotfile/pilotfile_convert.h" #include "ship/ship.h" #include "stats/medals.h" #include "weapon/weapon.h" diff --git a/code/pilotfile/pilotfile_convert.cpp b/code/pilotfile/pilotfile_convert.cpp index 249c24a78f..125254b2b9 100644 --- a/code/pilotfile/pilotfile_convert.cpp +++ b/code/pilotfile/pilotfile_convert.cpp @@ -30,7 +30,7 @@ pilotfile_convert::~pilotfile_convert() } } -void pilotfile_convert::startSection(Section::id section_id) +void pilotfile_convert::startSection(Section section_id) { Assert( cfp ); diff --git a/code/pilotfile/pilotfile_convert.h b/code/pilotfile/pilotfile_convert.h index a6657a99ee..3981ac2960 100644 --- a/code/pilotfile/pilotfile_convert.h +++ b/code/pilotfile/pilotfile_convert.h @@ -224,27 +224,25 @@ class pilotfile_convert { scoring_special_t multi_stats; // sections of a pilot file. includes both plr and csg sections - struct Section { - enum id { - Flags = 0x0001, - Info = 0x0002, - Loadout = 0x0003, - Controls = 0x0004, - Multiplayer = 0x0005, - Scoring = 0x0006, - ScoringMulti = 0x0007, - Techroom = 0x0008, - HUD = 0x0009, - Settings = 0x0010, - RedAlert = 0x0011, - Variables = 0x0012, - Missions = 0x0013, - Cutscenes = 0x0014, - }; + enum class Section { + Flags = 0x0001, + Info = 0x0002, + Loadout = 0x0003, + Controls = 0x0004, + Multiplayer = 0x0005, + Scoring = 0x0006, + ScoringMulti = 0x0007, + Techroom = 0x0008, + HUD = 0x0009, + Settings = 0x0010, + RedAlert = 0x0011, + Variables = 0x0012, + Missions = 0x0013, + Cutscenes = 0x0014, }; // for writing files, sets/updates section info - void startSection(Section::id section_id); + void startSection(Section section_id); void endSection(); // file offset of the size value for the current section (set with startSection()) size_t m_size_offset;