-
Notifications
You must be signed in to change notification settings - Fork 7
92 lines (87 loc) · 2.96 KB
/
pull-request.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
name: CI Build
on:
push:
jobs:
build:
runs-on: ubuntu-latest
services:
postgis11:
image: postgis/postgis:13-3.3
ports:
- 5432:5432
env:
POSTGRES_DB: mr_test
POSTGRES_USER: osm
POSTGRES_PASSWORD: osm
strategy:
matrix:
# Jdk 17 requires gradle 7.3+ https://docs.gradle.org/current/userguide/compatibility.html
java: [11, 17]
steps:
- uses: actions/checkout@v4
with:
path: 'java-client'
fetch-depth: 0
- uses: actions/checkout@v4
with:
repository: 'maproulette/maproulette-backend'
path: 'maproulette-backend'
fetch-depth: 0
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'sbt'
- name: Build maproulette-java-client
run: |
pushd java-client
./gradlew --info build
# Publish the artifacts and pom to a local directory for later inspection
./gradlew --info publish
- name: Build maproulette-backend sbt
run: |
pushd maproulette-backend
sbt compile
- name: Create the maproulette-backend dev.conf
run: |
pushd maproulette-backend
touch ./conf/dev.conf
echo 'include "application.conf"' >> ./conf/dev.conf
echo 'play.http.secret.key = "GHACTION_9GcV9VDuy5JjYXBFldfD1Q+4/O8z2AAo3e9ID/tE9iM="' >> ./conf/dev.conf
echo 'db.default {' >> ./conf/dev.conf
echo ' url="jdbc:postgresql://localhost:5432/mr_test"' >> ./conf/dev.conf
echo ' username="osm"' >> ./conf/dev.conf
echo ' password="osm"' >> ./conf/dev.conf
echo '}' >> ./conf/dev.conf
echo 'maproulette {' >> ./conf/dev.conf
echo ' debug=true' >> ./conf/dev.conf
echo ' bootstrap=true' >> ./conf/dev.conf
echo ' super.key="1234"' >> ./conf/dev.conf
echo ' super.accounts=""' >> ./conf/dev.conf
echo '}' >> ./conf/dev.conf
- name: Run the integration tests
env:
SBT_OPTS: "-Xms512M -Xmx1024M -Xss2M -XX:MaxMetaspaceSize=1024M"
API_HOST: 127.0.0.1:9000
host: 127.0.0.1
scheme: http
apiKey: 1234
run: |
pushd maproulette-backend
sbt -Dconfig.file=./conf/dev.conf run &
sleep 15
popd
pushd java-client
./gradlew --info --project-prop runIntegrationTests \
integrationTest \
--tests '*BatchUploaderIntegrationTest*' \
--tests '*ChallengeAPIIntegrationTest*' \
--tests '*ProjectAPIIntegrationTest*' \
--tests '*TaskAPIIntegrationTest*'
validation:
name: "Gradle Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v3