-
-
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 pull request #6 from r3w0p/1.1.0
1.1.0
- Loading branch information
Showing
11 changed files
with
216 additions
and
61 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Linux | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Linux GCC | ||
os: ubuntu-latest | ||
compiler_cc: gcc | ||
compiler_cpp: g++ | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install CMake and Ninja | ||
uses: lukka/get-cmake@latest | ||
with: | ||
cmakeVersion: "~3.27.0" # use most recent 3.27.x version | ||
ninjaVersion: "^1.0" # use most recent 1.x version | ||
|
||
- name: CMake Setup | ||
run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: CMake Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target caravan | ||
|
||
- name: Rename Executable | ||
working-directory: ./build | ||
run: mv caravan.exe caravan_linux_x64 | ||
|
||
- name: Upload Executable to Release | ||
uses: AButler/[email protected] | ||
with: | ||
files: ./build/caravan_linux_x64 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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,40 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
env: | ||
BUILD_TYPE: Debug | ||
|
||
jobs: | ||
testing: | ||
name: Testing | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Linux GCC | ||
os: ubuntu-latest | ||
compiler_cc: gcc | ||
compiler_cpp: g++ | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install CMake and Ninja | ||
uses: lukka/get-cmake@latest | ||
with: | ||
cmakeVersion: "~3.27.0" # use most recent 3.27.x version | ||
ninjaVersion: "^1.0" # use most recent 1.x version | ||
|
||
- name: CMake Setup | ||
run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: CMake Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target tests | ||
|
||
- name: Run Tests | ||
working-directory: ./build | ||
run: ctest --output-on-failure |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Build | ||
name: Windows | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
release: | ||
types: [ created ] | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
@@ -14,29 +14,6 @@ jobs: | |
strategy: | ||
matrix: | ||
include: | ||
- name: Linux Clang | ||
os: ubuntu-latest | ||
compiler_cc: clang | ||
compiler_cpp: clang++ | ||
|
||
- name: Linux GCC | ||
os: ubuntu-latest | ||
compiler_cc: gcc | ||
compiler_cpp: g++ | ||
|
||
# Commented out due to seemingly unresolvable issue possibly caused by FTXUI: | ||
# "Target "component" links to Threads::Threads but the target was not found." | ||
# | ||
#- name: MacOS Clang | ||
# os: macos-latest | ||
# compiler_c: clang | ||
# compiler_cpp: clang++ | ||
|
||
- name: Windows Clang | ||
os: windows-latest | ||
compiler_cc: clang | ||
compiler_cpp: clang++ | ||
|
||
- name: Windows GCC | ||
os: windows-latest | ||
compiler_cc: gcc | ||
|
@@ -57,3 +34,13 @@ jobs: | |
|
||
- name: CMake Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target caravan | ||
|
||
- name: Rename Executable | ||
working-directory: ./build | ||
run: mv caravan.exe caravan_windows_x64.exe | ||
|
||
- name: Upload Executable to Release | ||
uses: AButler/[email protected] | ||
with: | ||
files: ./build/caravan_windows_x64.exe | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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
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
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,17 @@ | ||
// Copyright (c) 2022-2024 r3w0p | ||
// The following code can be redistributed and/or | ||
// modified under the terms of the GPL-3.0 License. | ||
|
||
#ifndef CARAVAN_USER_BOT_FRIENDLY_H | ||
#define CARAVAN_USER_BOT_FRIENDLY_H | ||
|
||
#include "caravan/user/bot/normal.h" | ||
|
||
class UserBotFriendly : public UserBotNormal { | ||
public: | ||
explicit UserBotFriendly(PlayerName pn) : UserBotNormal(pn){}; | ||
|
||
std::string request_move(Game *game) override; | ||
}; | ||
|
||
#endif //CARAVAN_USER_BOT_FRIENDLY_H |
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
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
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
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,22 @@ | ||
// Copyright (c) 2022-2024 r3w0p | ||
// The following code can be redistributed and/or | ||
// modified under the terms of the GPL-3.0 License. | ||
|
||
#include <random> | ||
#include "caravan/user/bot/friendly.h" | ||
|
||
/* | ||
* PUBLIC | ||
*/ | ||
|
||
std::string UserBotFriendly::request_move(Game *game) { | ||
if (closed) { throw CaravanFatalException("Bot is closed."); } | ||
|
||
std::string move = generate_move(game, true, false, true); | ||
|
||
// Return move if able to generate one | ||
if (!move.empty()) { return move; } | ||
|
||
// If no useful move could be made, discard first card in hand | ||
return "D1"; | ||
} |
Oops, something went wrong.