Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c429dbd
chore: simplify gitignore
jarjk Oct 22, 2025
10c8aab
misc(server): rwir
jarjk Oct 22, 2025
5e772fa
misc(server): playable
jarjk Oct 23, 2025
4c5a856
server: join fix, refactors, `pay_out` impl
jarjk Oct 24, 2025
72845eb
misc(server): use Rocket.toml config
jarjk Oct 24, 2025
dbe24cb
misc(server): typo, delete unused
jarjk Oct 24, 2025
7d867d1
refactor: don't allow abbreviating MoveActions h(it), s(tand)
jarjk Oct 24, 2025
b71d304
fix(server): correct response for join, bet state fix
jarjk Oct 25, 2025
241e038
fix(server/json): don't (Partial|)Ord, but (Des|S)erialize
jarjk Oct 25, 2025
605a6dc
fix(server/json): return them
jarjk Oct 25, 2025
74b8edf
fix(client): funkier than ever, but works!
jarjk Oct 26, 2025
333fd2e
misc: delete most cpp server code
jarjk Oct 26, 2025
2553aca
fix(client): never better!
jarjk Oct 26, 2025
3df9c9f
refactor(client): move to it's own dir
jarjk Oct 26, 2025
f3232c4
ci(meson): don't option me
jarjk Oct 26, 2025
efd59ef
ci: add for server, refactor for client
jarjk Oct 26, 2025
c18f0c3
docs(server): add many doc comments, improve code readability and con…
jarjk Oct 27, 2025
bda885b
typo(server): again
jarjk Oct 27, 2025
68c7058
fix(client): tui::concat instead of std::format
jarjk Oct 28, 2025
32349ea
fix(client): allow specifying BJ_ADDR port
jarjk Oct 28, 2025
a69a94e
fix(server): don't count visits for now
jarjk Oct 28, 2025
e67da7b
misc(server): deck test
jarjk Oct 28, 2025
9c7baea
fix(server): add CORS
jarjk Nov 13, 2025
13742e7
misc: make default server port 5225 (jack)
jarjk Nov 13, 2025
eb0a929
fix(server): redirect index to repo
jarjk Nov 22, 2025
4e9996a
fix(server/join): response weakly-typed json that makes sense
jarjk Nov 22, 2025
8c50c61
refactor(server): improved code consistency, readability, don't Deser…
jarjk Nov 22, 2025
c73cf42
misc(server/structs): add further tests
jarjk Nov 23, 2025
85b4572
refactor(server): further code improvements, comments, test
jarjk Nov 23, 2025
44006aa
ci: workflow permission
jarjk Nov 23, 2025
058b238
ci: permissions
jarjk Nov 23, 2025
4bcc40a
fix(server): whoops, forgot to shuffle every now and then
jarjk Nov 23, 2025
ae380bb
fix(server): BJ payout 2:1 -> 3:2 => proper house-edge
jarjk Nov 23, 2025
603c049
refactor(server): rename BlackJack -> BJTable
csboo Nov 24, 2025
b3e5522
refactor(server): remove unused 'game_state' endpoint
csboo Nov 24, 2025
ecdb985
refactor(server): <rank> of <suit>
jarjk Nov 24, 2025
5176448
fix(server): proper CORS OPTIONS
jarjk Nov 24, 2025
8fc165a
refactor(server): export tests to files
jarjk Nov 24, 2025
661ab6a
misc(gitignore): deduplicate
jarjk Nov 24, 2025
96189c3
fix(client): proper MoveAction case
jarjk Nov 25, 2025
683a81e
ci(server): musl != glibc, build for both though
jarjk Nov 25, 2025
4615514
fix(server): give them a chance... (also, consider using `insta` for …
jarjk Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Checks:
abseil-*,
altera-*,
android-*,
bugprone-*,
Expand All @@ -22,6 +21,7 @@ Checks:
portability-*,
readability-*,
zircon-*,
-abseil-*,
-boost-*,
-llvmlibc-*,
-altera-unroll-loops,
Expand All @@ -35,6 +35,7 @@ Checks:
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-non-private-member-variables-in-classes,
-google-readability-todo,
-google-explicit-constructor,
-google-build-using-namespace,
Expand All @@ -43,6 +44,7 @@ Checks:
-fuchsia-default-arguments-declarations,
-fuchsia-default-arguments-calls,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-readability-identifier-length,
-readability-magic-numbers,
-altera-struct-pack-align,
Expand Down Expand Up @@ -102,7 +104,6 @@ Checks:
# -llvmlibc-implementation-in-namespace
# -llvmlibc-restrict-system-libc-headers
# -modernize-avoid-c-arrays
# -modernize-use-nodiscard
# -modernize-use-trailing-return-type
# -readability-identifier-length
# -readability-isolate-declaration
Expand Down
82 changes: 0 additions & 82 deletions .github/workflows/build.yml

This file was deleted.

112 changes: 112 additions & 0 deletions .github/workflows/client-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CI client with meson

on:
workflow_dispatch:
workflow_call:
push:
paths:
- "**.cpp"
- "**.hpp"
- ".github/workflows/**"
- "meson.*"
tags: ["client-v*.*.*"]

jobs:
build:
name: Build and Test on ${{ matrix.os }} with Meson
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest, ubuntu-22.04-arm]
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup MSVC dev environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Set cl.exe for windows build
if: runner.os == 'Windows'
run: |
echo "CC=cl" >> "$GITHUB_ENV"
echo "CXX=cl" >> "$GITHUB_ENV"

- name: Set sys and executable name variables
id: set_vars
shell: bash
run: |
SYS=$(echo "${{ runner.arch }}-${{ runner.os }}" | tr '[:upper:]' '[:lower:]' | sed "s/x64/x86_64/" | sed "s/arm64/aarch64/")

echo "artifact_name=blackjackpp-${SYS}" >> "$GITHUB_ENV"
echo "sys=${SYS}" >> "$GITHUB_ENV"

- uses: actions/cache@v4
with:
path: builddir/
key: ${{ env.sys }}

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: 'build-sys-pip-pkgs.txt'
- run: pip install -r build-sys-pip-pkgs.txt

- name: Reconfigure Meson
run: meson setup -Ddefault_library=static -Db_vscrt=mt --wipe --buildtype=release --optimization=3 builddir/

- name: compile
run: meson compile -C builddir/ -v

- name: Upload compilation log
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ env.sys }}_meson_logs
path: builddir/meson-logs/*

- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
builddir/blackjackpp-client
builddir/blackjackpp-client.exe
release:
permissions:
contents: write
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: build
steps:
- name: Download prebuilt binary artifacts
uses: actions/download-artifact@v5
with:
path: release-artifacts

- name: Prepare artifacts
run: |
set -e # exit on errors
tree

for platform in $(ls); do # Loop through each artifact subdirectory
echo "working on: '$platform'"
for bin in $(ls "$platform"); do
echo "binary found: '$bin'"
name="$platform-$(echo "$bin" | cut -d '-' -f 2)"
mv "$platform/$bin" "$name"
done
rm -r "$platform"
done
ls -lARh . # beautiful!

- name: Create a GitHub release
uses: softprops/action-gh-release@v2
with:
# draft: true
generate_release_notes: true
files: release-artifacts/*
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
Comment thread Fixed
48 changes: 0 additions & 48 deletions .github/workflows/release.yml

This file was deleted.

97 changes: 97 additions & 0 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: server CI and CD

on:
workflow_dispatch:
workflow_call:
push:
paths:
- "**.rs"
- ".github/workflows/**"
- "Cargo.*"
tags: ["server-v*.*.*"]

env:
CARGO_TERM_COLOR: always

jobs:
check-test-build:
permissions:
contents: read
strategy:
matrix:
include:
- { os: "macos-latest", target: "aarch64-apple-darwin" }
- { os: "ubuntu-22.04", target: "x86_64-unknown-linux-gnu" } # needed for glibc compatibility
- { os: "ubuntu-24.04", target: "x86_64-unknown-linux-musl" }
- { os: "windows-latest", target: "x86_64-pc-windows-msvc", ext: ".exe" }
- { os: "ubuntu-22.04-arm", target: "aarch64-unknown-linux-gnu" } # needed for glibc compatibility
- { os: "ubuntu-24.04-arm", target: "aarch64-unknown-linux-musl" }

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v5
- uses: swatinem/rust-cache@v2
- uses: davidlattimore/wild-action@latest # faster linking where available (linux atm.)

- name: install rust target
run: rustup target add ${{ matrix.target }}

- name: Check for errors
run: cargo check --target ${{ matrix.target }} --all-targets --verbose

- name: Run tests
run: cargo test --target ${{ matrix.target }} --verbose

- name: Check code formatting
run: cargo fmt --all --check --verbose

- name: Check code with clippy
run: cargo clippy --target ${{ matrix.target }} --all-targets --verbose

- name: Set build mode
shell: bash
run: if [ "${{github.ref_type}}" == "tag" ]; then echo "BMODE=release">>"$GITHUB_ENV"; fi

- name: Build in ${{env.BMODE || 'debug'}} mode
run: cargo build --target ${{ matrix.target }} --verbose --${{env.BMODE}}

- name: Prepare artifact
shell: bash
run: |
mkdir -p dist
cp "target/${{ matrix.target }}/${{env.BMODE || 'debug'}}/svr-bj${{ matrix.ext }}" dist/svr-bj-${{ matrix.target }}${{ matrix.ext }}
tree dist || ls -la dist

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: svr-bj-${{ matrix.target }}
path: dist/svr-bj*

auto-release:
Comment thread Fixed
permissions:
contents: write
name: Release on tag push
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: check-test-build
steps:
- uses: actions/checkout@v5

- uses: actions/download-artifact@v5
with:
pattern: "**/svr-bj-*"
path: target/release-artifacts
merge-multiple: true

- name: What's up?
run: tree target/release-artifacts # beautiful!

- name: Create a GitHub release
uses: softprops/action-gh-release@v2
with:
# draft: true
generate_release_notes: true
files: target/release-artifacts/*
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
Comment thread Fixed
Loading