-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.24 KB
/
api-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
name: Api CI
on:
push:
paths:
- "api/**"
- ".github/workflows/api-ci.yml"
workflow_dispatch:
jobs:
run-tests:
name: Run Api tests
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: admin
POSTGRES_PASSWORD: user
POSTGRES_DB: beerpong
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Set up JDK 21 corretto
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- run: mvn verify -Dspringdoc.skip=true
env:
POSTGRES_USER: admin
POSTGRES_PASSWORD: user
POSTGRES_URL: jdbc:postgresql://localhost:5432/beerpong
API_BASE_URL: http://localhost:8080/
working-directory: api