-
Notifications
You must be signed in to change notification settings - Fork 17
46 lines (44 loc) · 1.33 KB
/
backtest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Backend
on:
pull_request:
branches:
- main
paths:
- "server/**"
- ".github/workflows/backtest.yaml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restoreß dependencies
uses: actions/cache@v3
with:
path: "**/server/test-web-server/node_modules"
key: ${{ runner.os }}-v2-${{ hashFiles('**/server/test-web-server/package-lock.json') }}
- name: Restore gradle dependencies
uses: actions/cache@v3
with:
path: "~/.gradle"
key: ${{ runner.os }}-modules-${{ hashFiles('**/server/build.gradle') }}
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Run containers
run: docker-compose -f server/docker-compose-test.yaml up -d
- name: Wait for database to start
run: |
for i in `seq 1 60`;
do
nc -z localhost 3307 && echo Success && exit 0
echo -n .
sleep 1
done
echo Failed waiting for mysql && exit 1
- name: Build and test
run: ./server/gradlew clean build -p server --info