Skip to content

Commit

Permalink
Merge branch 'v0.x.x-ci' into 'v0.x.x'
Browse files Browse the repository at this point in the history
V0.x.x ci

Closes #9 and #10

See merge request edward/fly-by-knight!5
  • Loading branch information
ewsandor committed Apr 3, 2023
2 parents 3537b4f + d46f21c commit f2ff331
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ VS
*.pgn
*.lnk
flyByKnight
xboard.debug
xboard.debug
build
107 changes: 107 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml

# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
default:
tags:
- docker

variables:
GIT_STRATEGY: clone

stages: # List of stages for jobs, and their order of execution
- build
- test

.apt_dependencies: &apt_dependencies
- echo "Installing dependencies..."
- apt update
- apt install -y --no-install-recommends gcc g++ make cmake git
- echo "Installing dependencies complete."

.build_step: &build_step
- echo "Compiling the code..."
- mkdir build-debug
- cd build-debug
- cmake .. -DCMAKE_BUILD_TYPE=Debug
- make -j$(nproc)
- cd ..
- mkdir build
- cd build
- cmake ..
- make -j$(nproc)
- echo "Compile complete."

build-debian:
stage: build
image: debian:latest
tags:
- docker
- x86_64
script:
- *apt_dependencies
- *build_step
artifacts:
when: always
paths:
- /builds/edward/fly-by-knight/build/flybyknight0
- /builds/edward/fly-by-knight/build-debug/flybyknight0

build-debian-arm64:
stage: build
image: debian:latest
tags:
- docker
- arm64
script:
- *apt_dependencies
- *build_step
artifacts:
when: always
paths:
- /builds/edward/fly-by-knight/build/flybyknight0
- /builds/edward/fly-by-knight/build-debug/flybyknight0

build-ubuntu:
stage: build
image: ubuntu:latest
script:
- *apt_dependencies
- *build_step
artifacts:
when: always
paths:
- /builds/edward/fly-by-knight/build/flybyknight0
- /builds/edward/fly-by-knight/build-debug/flybyknight0

fedora:
stage: build
image: fedora:latest
script:
- echo "Installing dependencies..."
- dnf install -y gcc gcc-c++ cmake git
- echo "Installing dependencies complete."
- *build_step
artifacts:
when: always
paths:
- /builds/edward/fly-by-knight/build/flybyknight0
- /builds/edward/fly-by-knight/build-debug/flybyknight0

include:
- template: Security/SAST.gitlab-ci.yml

sast:
tags:
- docker
- x86_64
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required (VERSION 3.18)
project (flybyknight)

option (BUILD_AS_LEGACY "ON to build Fly by Knight as a legacy version with appropriate suffix. OFF to build as main version with no suffix." ON)

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFBK_DEBUG_BUILD")

if (MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall -Wextra -pedantic)
#add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()

add_executable(flybyknight board.cpp game.cpp main.cpp moveTree.cpp piece.cpp)
if(BUILD_AS_LEGACY)
set_target_properties(flybyknight PROPERTIES OUTPUT_NAME "flybyknight0")
endif()

find_package(Threads REQUIRED)
target_link_libraries(flybyknight PRIVATE Threads::Threads)

install(TARGETS flybyknight)
6 changes: 5 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ void *inputQueuer(void*){

int main(int argc, char* argv[]){

handleOutput("feature myname=\"Fly By Knight 0.3.5\" sigint=0 sigterm=0 ping=1 time=0 colors=0");
handleOutput("feature myname=\"Fly By Knight 0.4.1"
#ifdef FBK_DEBUG_BUILD
" <debug "__DATE__ " " __TIME__">"
#endif
"\" sigint=0 sigterm=0 ping=1 time=0 colors=0");

#ifdef BOOST_THREAD_LIBRARY
boost::thread inputQueuerThread(inputQueuer);
Expand Down
30 changes: 0 additions & 30 deletions makefile

This file was deleted.

0 comments on commit f2ff331

Please sign in to comment.