-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.44 KB
/
ci.yml
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
52
53
54
55
56
57
58
name: Build
on: [push]
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
IMG: app
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set env.BRANCH
run: echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- run: npm ci
- run: npm test
- run: npm run build
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: ./gradlew jar
- name: Start Test DB
run: docker-compose up -d db && sleep 3 && docker-compose logs
- name: Test Server
run: ./gradlew --info test
- name: E2E Tests
run: ./gradlew --info -Pheadless=true e2eTest
- name: Stop Test DB
run: docker-compose down
- uses: actions/upload-artifact@v2
if: always()
with:
name: Test reports
path: build/reports/tests
- name: Build Docker image
run: docker build -t $IMG:$GITHUB_SHA .