-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v0.x.x-ci' into 'v0.x.x'
V0.x.x ci Closes #9 and #10 See merge request edward/fly-by-knight!5
- Loading branch information
Showing
5 changed files
with
139 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ VS | |
*.pgn | ||
*.lnk | ||
flyByKnight | ||
xboard.debug | ||
xboard.debug | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters