Compare commits

...

5 commits

Author SHA1 Message Date
b41145b85c
Merge pull request 'feat: add coinside result' (!195) from feat-coinside into main
All checks were successful
Release / Release (push) Successful in 59s
Release / Build Frontend Image (push) Successful in 24s
Release / Build Backend Image (push) Successful in 28s
Reviewed-on: #195
Reviewed-by: Jan K9f <jan@kjan.email>
2025-05-15 10:12:19 +00:00
963516a5bd
Merge branch 'main' into feat-coinside
All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / eslint (pull_request) Has been skipped
CI / Docker frontend validation (pull_request) Has been skipped
CI / oxlint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 47s
CI / Docker backend validation (pull_request) Successful in 1m8s
2025-05-15 10:10:51 +00:00
Phan Huy Tran
d7f2e72a15 feat: add coinside result
All checks were successful
CI / Get Changed Files (pull_request) Successful in 7s
CI / Docker frontend validation (pull_request) Has been skipped
CI / eslint (pull_request) Has been skipped
CI / oxlint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 51s
CI / Docker backend validation (pull_request) Successful in 52s
2025-05-15 11:44:56 +02:00
d42209d1c9
Merge pull request 'Update some stuff in the pipeline' (!193) from pipeline-optimization into main
Reviewed-on: #193
2025-05-15 09:15:12 +00:00
47e04567a9 perf: Update bun jobs
All checks were successful
CI / Get Changed Files (pull_request) Successful in 7s
CI / Docker frontend validation (pull_request) Successful in 21s
CI / oxlint (pull_request) Successful in 21s
CI / Docker backend validation (pull_request) Successful in 22s
CI / eslint (pull_request) Successful in 29s
CI / prettier (pull_request) Successful in 28s
CI / test-build (pull_request) Successful in 46s
CI / Checkstyle Main (pull_request) Successful in 1m3s
2025-05-15 11:13:31 +02:00
3 changed files with 11 additions and 18 deletions

View file

@ -113,17 +113,15 @@ jobs:
push: false
eslint:
runs-on: ubuntu-latest
runs-on: docker
container:
image: git.kjan.de/actions/runner-bun:latest
name: eslint
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
working-directory: ./frontend
with:
@ -142,17 +140,15 @@ jobs:
bun run lint
oxlint:
runs-on: ubuntu-latest
runs-on: docker
name: oxlint
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
image: git.kjan.de/actions/runner-bun:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
working-directory: ./frontend
with:
@ -171,17 +167,15 @@ jobs:
bun run oxlint
prettier:
runs-on: ubuntu-latest
runs-on: docker
name: prettier
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
image: git.kjan.de/actions/runner-bun:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
working-directory: ./frontend
with:
@ -200,17 +194,15 @@ jobs:
bun run format:check
test-build:
runs-on: ubuntu-latest
runs-on: docker
name: test-build
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
image: git.kjan.de/actions/runner-bun:latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
working-directory: ./frontend
with:

View file

@ -12,4 +12,5 @@ import java.math.BigDecimal;
public class CoinflipResult {
private boolean isWin;
private BigDecimal payout;
private CoinSide coinSide;
}

View file

@ -19,8 +19,8 @@ public class CoinflipService {
public CoinflipResult play(UserEntity user, CoinflipDto coinflipDto) {
this.balanceService.subtractFunds(user, coinflipDto.getBetAmount());
CoinflipResult coinflipResult = new CoinflipResult(false, BigDecimal.ZERO);
CoinSide coinSide = this.random.nextBoolean() ? CoinSide.HEAD : CoinSide.TAILS;
CoinflipResult coinflipResult = new CoinflipResult(false, BigDecimal.ZERO, coinSide);
if (coinSide == coinflipDto.getCoinSide()) {
coinflipResult.setWin(true);