From 734ae5509fc625e5a519b6d2a7bc33b67b71767e Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Fri, 4 Oct 2024 21:28:49 -0400 Subject: [PATCH] Adding drone builds --- .drone.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 6 ++++++ test/CMakeLists.txt | 8 ++++---- test/hello_test.cc | 10 --------- 4 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 .drone.yml create mode 100644 Dockerfile delete mode 100644 test/hello_test.cc diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7455469 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,49 @@ +kind: pipeline +type: docker +name: chessboard + +trigger: + branch: + - main + event: + - push + +steps: +- name: build + image: git.pipsquire.com/djweber12/Chess_Board_Sim:latest + commands: + - cmake -S . -B build + - cmake --build build + +--- +kind: pipeline +type: docker +name: chessboard_builder + +trigger: + branch: + - main + event: + - push + +steps: + - name: docker + image: plugins/docker + settings: + repo: git.pipsquire.com/djweber12/Chess_Board_Sim + registry: git.pipsquire.com + username: + from_secret: docker_username + password: + from_secret: docker_password + +# +# - name: test +# image: foo:latest +# commands: +# - cmake -s . -b build +# - cmake --build build +# +# volumes: +# - name: dockersock + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a513d5b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM ubuntu:22.04 + +run apt-get update && \ + apt-get install -y libsdl2-dev libsdl2-2.0-0 cmake g++ && \ + apt-get clean + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2e8c618..2619554 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -33,18 +33,18 @@ foreach (_headerFile ${headers}) endforeach() add_executable( - hello_test + chess_test # ${cpp_sources} ${test_sources} ${c_sources} ) -target_include_directories(hello_test PRIVATE ${include_dirs}) +target_include_directories(chess_test PRIVATE ${include_dirs}) target_link_libraries( - hello_test + chess_test GTest::gtest_main SDL2::SDL2 ) include(GoogleTest) -gtest_discover_tests(hello_test) +gtest_discover_tests(chess_test) diff --git a/test/hello_test.cc b/test/hello_test.cc deleted file mode 100644 index 9432d54..0000000 --- a/test/hello_test.cc +++ /dev/null @@ -1,10 +0,0 @@ -#include - -// Demonstrate some basic assertions. -TEST(HelloTest, BasicAssertions) { - // Expect two strings not to be equal. - EXPECT_STRNE("hello", "world"); - // Expect equality. - EXPECT_EQ(7 * 6, 42); -} -