-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (79 loc) · 2.45 KB
/
sbt-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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: SBT build and test
on:
workflow_call:
outputs:
jar-artifact:
description: "Name of the executable JAR artifact."
value: "rpki-publication-server-jar"
test-reports:
description: "Name of the test reports artifact."
value: "test-reports"
jobs:
sbt-build-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pubserver_test
POSTGRES_USER: pubserver
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Check out repository code
uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]
- name: Cache ivy cache
id: ivy-cache
uses: actions/cache@v3
with:
path: |
~/.ivy2
~/.sbt
key: ${{ runner.os }}--${{ hashFiles('build.sbt') }}
- name: Setup DB
run: psql -h localhost -U ${POSTGRES_USER} ${POSTGRES_DB} -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'
env:
PGPASSWORD: postgres
POSTGRES_DB: pubserver_test
POSTGRES_USER: pubserver
- name: Compile
run: sbt compile
env:
POSTGRES_URL: "jdbc:postgresql://localhost:5432/pubserver_test"
POSTGRES_PASSWORD: postgres
CI_COMMIT_SHA: "${GITHUB_SHA}"
- name: Test & package
run: sbt coverage test coverageReport
env:
POSTGRES_URL: "jdbc:postgresql://localhost:5432/pubserver_test"
POSTGRES_PASSWORD: postgres
CI_COMMIT_SHA: "${GITHUB_SHA}"
- name: Package
run: sbt assembly
env:
POSTGRES_URL: "jdbc:postgresql://localhost:5432/pubserver_test"
POSTGRES_PASSWORD: postgres
CI_COMMIT_SHA: "${GITHUB_SHA}"
- name: Upload jar
uses: actions/upload-artifact@v3
with:
name: rpki-publication-server-jar
path: target/rpki-publication-server.*
- name: Upload reports
uses: actions/upload-artifact@v3
with:
name: reports
path: |
target/scoverage-report/**/*
target/test-reports/**/*