-
Notifications
You must be signed in to change notification settings - Fork 17
51 lines (49 loc) · 1.46 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
47
48
49
50
51
name: Backend
on:
push:
branches:
- main
paths:
- "server/**"
- ".github/workflows/backtest.yaml"
pull_request:
branches:
- main
paths:
- "server/**"
- ".github/workflows/backtest.yaml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Restore web server node dependencies
uses: actions/cache@v2
with:
path: "**/server/test-web-server/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/server/test-web-server/yarn.lock') }}
- name: Restore gradle dependencies
uses: actions/cache@v2
with:
path: "~/.gradle"
key: ${{ runner.os }}-modules-${{ hashFiles('**/server/build.gradle') }}
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Run containers
run: docker-compose -f server/docker-compose.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