-
Notifications
You must be signed in to change notification settings - Fork 31
76 lines (64 loc) · 2.23 KB
/
build.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Maven Build
on:
push:
schedule:
- cron: '0 15 * * *' # daily at 3pm
jobs:
build-sample-projects:
strategy:
fail-fast: false
matrix:
projects: [ 'spring-boot-example', 'jakarta-ee-example' ]
runs-on: ubuntu-20.04
name: ${{ matrix.projects }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11.0
distribution: 'adopt'
java-package: 'jdk'
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.projects }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.projects }}-
- name: Build the project
working-directory: ${{ matrix.projects }}
run: ./mvnw -B verify
- name: Log test output on failure
if: failure() || cancelled()
run: find . -type f -path "*test-reports/*-output.txt" -exec tail -n +1 {} +
run-performance-tests:
runs-on: ubuntu-20.04
name: performance-tests
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11.0
distribution: 'adopt'
java-package: 'jdk'
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-gatling-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-gatling-
- name: Start the infrastructure
run: docker-compose --file spring-boot-example/docker-compose.yml up -d
- name: Run Gatling performance tests
run: |
mvn --file spring-boot-example/pom.xml -B spring-boot:run &
mvn --file spring-boot-example/pom.xml -B gatling:test
- name: Run ApacheBench performance tests
run: |
mvn --file spring-boot-example/pom.xml -B spring-boot:run &
ab -p spring-boot-example/src/test/resources/apachebench/create-customer-request.json -T application/json -c 10 -n 1000 http://localhost:8080/api/customers