Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
b41145b85c |
|||
963516a5bd |
|||
|
d7f2e72a15 | ||
d42209d1c9 |
|||
47e04567a9 |
3 changed files with 11 additions and 18 deletions
|
@ -113,17 +113,15 @@ jobs:
|
||||||
push: false
|
push: false
|
||||||
|
|
||||||
eslint:
|
eslint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: git.kjan.de/actions/runner-bun:latest
|
||||||
name: eslint
|
name: eslint
|
||||||
needs: changed_files
|
needs: changed_files
|
||||||
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install bun
|
|
||||||
uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
with:
|
with:
|
||||||
|
@ -142,17 +140,15 @@ jobs:
|
||||||
bun run lint
|
bun run lint
|
||||||
|
|
||||||
oxlint:
|
oxlint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
name: oxlint
|
name: oxlint
|
||||||
needs: changed_files
|
needs: changed_files
|
||||||
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: git.kjan.de/actions/runner-bun:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install bun
|
|
||||||
uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
with:
|
with:
|
||||||
|
@ -171,17 +167,15 @@ jobs:
|
||||||
bun run oxlint
|
bun run oxlint
|
||||||
|
|
||||||
prettier:
|
prettier:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
name: prettier
|
name: prettier
|
||||||
needs: changed_files
|
needs: changed_files
|
||||||
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: git.kjan.de/actions/runner-bun:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install bun
|
|
||||||
uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
with:
|
with:
|
||||||
|
@ -200,17 +194,15 @@ jobs:
|
||||||
bun run format:check
|
bun run format:check
|
||||||
|
|
||||||
test-build:
|
test-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
name: test-build
|
name: test-build
|
||||||
needs: changed_files
|
needs: changed_files
|
||||||
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: git.kjan.de/actions/runner-bun:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install bun
|
|
||||||
uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -12,4 +12,5 @@ import java.math.BigDecimal;
|
||||||
public class CoinflipResult {
|
public class CoinflipResult {
|
||||||
private boolean isWin;
|
private boolean isWin;
|
||||||
private BigDecimal payout;
|
private BigDecimal payout;
|
||||||
|
private CoinSide coinSide;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,8 @@ public class CoinflipService {
|
||||||
public CoinflipResult play(UserEntity user, CoinflipDto coinflipDto) {
|
public CoinflipResult play(UserEntity user, CoinflipDto coinflipDto) {
|
||||||
this.balanceService.subtractFunds(user, coinflipDto.getBetAmount());
|
this.balanceService.subtractFunds(user, coinflipDto.getBetAmount());
|
||||||
|
|
||||||
CoinflipResult coinflipResult = new CoinflipResult(false, BigDecimal.ZERO);
|
|
||||||
CoinSide coinSide = this.random.nextBoolean() ? CoinSide.HEAD : CoinSide.TAILS;
|
CoinSide coinSide = this.random.nextBoolean() ? CoinSide.HEAD : CoinSide.TAILS;
|
||||||
|
CoinflipResult coinflipResult = new CoinflipResult(false, BigDecimal.ZERO, coinSide);
|
||||||
if (coinSide == coinflipDto.getCoinSide()) {
|
if (coinSide == coinflipDto.getCoinSide()) {
|
||||||
coinflipResult.setWin(true);
|
coinflipResult.setWin(true);
|
||||||
|
|
||||||
|
|
Reference in a new issue