-
Notifications
You must be signed in to change notification settings - Fork 38
133 lines (127 loc) · 3.98 KB
/
scala.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: MapRoulette Backend CI
on:
push:
pull_request:
jobs:
generate_app_secret:
runs-on: ubuntu-latest
outputs:
application_secret: ${{ steps.generate_app_secret.outputs.application_app_secret }}
steps:
- name: Generate Playframework APPLICATION_SECRET
id: generate_app_secret
run: echo "application_app_secret=$(openssl rand -base64 32)" >> "$GITHUB_OUTPUT"
sbt_formatChecks_dependencyTree:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: sbt
- name: Create sbt dependencyTree
env:
CI: true
run: |
sbt -Dsbt.log.format=false 'set asciiGraphWidth := 10000' 'dependencyTree' 'evicted'
- name: Verify code format checks pass
env:
CI: true
run: |
sbt -Dsbt.log.format=false generateRoutesFile scalafmtCheckAll scalafmtSbtCheck 'scalafixAll --check'
sbt_tests_jacoco:
runs-on: ubuntu-latest
needs: generate_app_secret
services:
postgis:
image: postgis/postgis:16-3.4
ports:
- 5432:5432
env:
POSTGRES_DB: mr_test
POSTGRES_USER: osm
POSTGRES_PASSWORD: osm
strategy:
matrix:
java: [ 17 ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: sbt
- name: Run sbt tests with jacoco analysis
env:
APPLICATION_SECRET: ${{ needs.generate_app_secret.outputs.application_secret }}
CI: true
MR_TEST_DB_NAME: "mr_test"
MR_TEST_DB_USER: "osm"
MR_TEST_DB_PASSWORD: "osm"
run: |
sbt -Dsbt.log.format=false jacoco
build:
runs-on: ubuntu-latest
needs: generate_app_secret
services:
postgis:
image: postgis/postgis:13-3.3
ports:
- 5432:5432
env:
POSTGRES_DB: mr_test
POSTGRES_USER: osm
POSTGRES_PASSWORD: osm
strategy:
matrix:
java: [17]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: 'osmlab/maproulette-java-client'
path: 'java-client'
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
# https://github.com/actions/setup-java?tab=readme-ov-file#install-multiple-jdks
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: sbt
- name: Run sbt compile
env:
CI: true
run: sbt -Dsbt.log.format=false compile
- name: Create the dev.conf
run: |
touch ./conf/dev.conf
echo 'include "application.conf"' >> ./conf/dev.conf
echo 'maproulette {' >> ./conf/dev.conf
echo ' debug=true' >> ./conf/dev.conf
echo ' bootstrap=true' >> ./conf/dev.conf
echo '}' >> ./conf/dev.conf
- name: Run maproulette and the maproulette-java-client integration tests
env:
# maproulette overrides
APPLICATION_SECRET: ${{ needs.generate_app_secret.outputs.application_secret }}
CI: true
SBT_OPTS: "-Xms512M -Xmx1024M -Xss2M -XX:MaxMetaspaceSize=1024M"
MR_SUPER_KEY: 1234
MR_DATABASE_URL: "jdbc:postgresql://localhost:5432/mr_test"
MR_DATABASE_USERNAME: "osm"
MR_DATABASE_PASSWORD: "osm"
# maproulette-java-client overrides
host: 127.0.0.1
scheme: http
apiKey: 1234
run: |
sbt -Dsbt.log.format=false -Dconfig.file=./conf/dev.conf run &
sleep 10
pushd java-client
./gradlew --info --project-prop runIntegrationTests \
clean integrationTest \
--tests '*BatchUploaderIntegrationTest*' \
--tests '*ChallengeAPIIntegrationTest*' \
--tests '*ProjectAPIIntegrationTest*'