-
Notifications
You must be signed in to change notification settings - Fork 2
serwir(rocket) #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jarjk
wants to merge
42
commits into
master
Choose a base branch
from
serwir
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
serwir(rocket) #28
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
c429dbd
chore: simplify gitignore
jarjk 10c8aab
misc(server): rwir
jarjk 5e772fa
misc(server): playable
jarjk 4c5a856
server: join fix, refactors, `pay_out` impl
jarjk 72845eb
misc(server): use Rocket.toml config
jarjk dbe24cb
misc(server): typo, delete unused
jarjk 7d867d1
refactor: don't allow abbreviating MoveActions h(it), s(tand)
jarjk b71d304
fix(server): correct response for join, bet state fix
jarjk 241e038
fix(server/json): don't (Partial|)Ord, but (Des|S)erialize
jarjk 605a6dc
fix(server/json): return them
jarjk 74b8edf
fix(client): funkier than ever, but works!
jarjk 333fd2e
misc: delete most cpp server code
jarjk 2553aca
fix(client): never better!
jarjk 3df9c9f
refactor(client): move to it's own dir
jarjk f3232c4
ci(meson): don't option me
jarjk efd59ef
ci: add for server, refactor for client
jarjk c18f0c3
docs(server): add many doc comments, improve code readability and con…
jarjk bda885b
typo(server): again
jarjk 68c7058
fix(client): tui::concat instead of std::format
jarjk 32349ea
fix(client): allow specifying BJ_ADDR port
jarjk a69a94e
fix(server): don't count visits for now
jarjk e67da7b
misc(server): deck test
jarjk 9c7baea
fix(server): add CORS
jarjk 13742e7
misc: make default server port 5225 (jack)
jarjk eb0a929
fix(server): redirect index to repo
jarjk 4e9996a
fix(server/join): response weakly-typed json that makes sense
jarjk 8c50c61
refactor(server): improved code consistency, readability, don't Deser…
jarjk c73cf42
misc(server/structs): add further tests
jarjk 85b4572
refactor(server): further code improvements, comments, test
jarjk 44006aa
ci: workflow permission
jarjk 058b238
ci: permissions
jarjk 4bcc40a
fix(server): whoops, forgot to shuffle every now and then
jarjk ae380bb
fix(server): BJ payout 2:1 -> 3:2 => proper house-edge
jarjk 603c049
refactor(server): rename BlackJack -> BJTable
csboo b3e5522
refactor(server): remove unused 'game_state' endpoint
csboo ecdb985
refactor(server): <rank> of <suit>
jarjk 5176448
fix(server): proper CORS OPTIONS
jarjk 8fc165a
refactor(server): export tests to files
jarjk 661ab6a
misc(gitignore): deduplicate
jarjk 96189c3
fix(client): proper MoveAction case
jarjk 683a81e
ci(server): musl != glibc, build for both though
jarjk 4615514
fix(server): give them a chance... (also, consider using `insta` for …
jarjk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,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') }} | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,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: | ||
|
|
||
| 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') }} | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.