diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..b4bd387 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,50 @@ +name: MacOS + +#on: +# release: +# types: [ created ] + +on: + push: + branches: [ "1.2.0" ] + +env: + BUILD_TYPE: Release + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - name: MacOS Clang + os: macos-latest + compiler_cc: clang + compiler_cpp: clang++ + + 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 caravan_macos_x64 + + #- name: Upload Executable to Release + # uses: AButler/upload-release-assets@v3.0 + # with: + # files: ./build/caravan_macos_x64 + # repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/caravan/main.cpp b/src/caravan/main.cpp index cdcaf31..230acda 100644 --- a/src/caravan/main.cpp +++ b/src/caravan/main.cpp @@ -69,27 +69,27 @@ int main(int argc, char *argv[]) { bool imbalanced = result["imbalanced"].as(); if (pvp && bots) { - printf("Game cannot be both Player vs Player and Bot vs Bot."); + printf("Game cannot be both Player vs Player and Bot vs Bot.\n"); exit(EXIT_FAILURE); } if(first < FIRST_ABC || first > FIRST_DEF) { - printf("First player must be either %d or %d.", FIRST_ABC, FIRST_DEF); + printf("First player must be either %d or %d.\n", FIRST_ABC, FIRST_DEF); exit(EXIT_FAILURE); } if (cards < DECK_CARAVAN_MIN || cards > DECK_CARAVAN_MAX) { - printf("Caravan decks must have between %d and %d cards (inclusive).", DECK_CARAVAN_MIN, DECK_CARAVAN_MAX); + printf("Caravan decks must have between %d and %d cards (inclusive).\n", DECK_CARAVAN_MIN, DECK_CARAVAN_MAX); exit(EXIT_FAILURE); } if (samples < SAMPLE_DECKS_MIN || samples > SAMPLE_DECKS_MAX) { - printf("Number of caravan deck samples must be between %d and %d (inclusive).", SAMPLE_DECKS_MIN, SAMPLE_DECKS_MIN); + printf("Number of caravan deck samples must be between %d and %d (inclusive).\n", SAMPLE_DECKS_MIN, SAMPLE_DECKS_MIN); exit(EXIT_FAILURE); } if(delay < 0) { - printf("Bot delay cannot be a negative number."); + printf("Bot delay cannot be a negative number.\n"); exit(EXIT_FAILURE); } @@ -122,11 +122,11 @@ int main(int argc, char *argv[]) { view = new ViewTUI(&vc, game); } catch (CaravanException &e) { - printf("%s", e.what().c_str()); + printf("%s\n", e.what().c_str()); exit(EXIT_FAILURE); } catch (std::exception &e) { - printf("%s", e.what()); + printf("%s\n", e.what()); exit(EXIT_FAILURE); }