Skip to content

Commit ab1477c

Browse files
author
Michael Cuthbert
authored
Merge pull request #85 from osmlab/ljdelight/ghActionsIntegrationTests
Run CI integration tests for PRs and branches
2 parents b004bbc + 9cd8aae commit ab1477c

File tree

1 file changed

+67
-6
lines changed

1 file changed

+67
-6
lines changed

.github/workflows/pull-request.yml

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
1-
name: Pull Request Build
2-
on: [pull_request]
1+
name: CI Build
2+
on:
3+
push:
4+
pull_request:
5+
36
jobs:
47
build:
58
runs-on: ubuntu-latest
9+
services:
10+
postgis11:
11+
image: postgis/postgis:11-2.5
12+
ports:
13+
- 5432:5432
14+
env:
15+
POSTGRES_DB: mr_test
16+
POSTGRES_USER: osm
17+
POSTGRES_PASSWORD: osm
18+
619
strategy:
720
matrix:
821
# Jdk 17 requires gradle 7.3+ https://docs.gradle.org/current/userguide/compatibility.html
922
java: [11]
23+
1024
steps:
11-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
26+
with:
27+
path: 'java-client'
28+
fetch-depth: 0
29+
- uses: actions/checkout@v3
1230
with:
31+
repository: 'maproulette/maproulette2'
32+
path: 'maproulette2'
1333
fetch-depth: 0
1434
- name: Set up JDK ${{ matrix.java }}
1535
uses: actions/setup-java@v2
1636
with:
17-
distribution: 'zulu'
37+
distribution: 'temurin'
1838
java-version: ${{ matrix.java }}
1939
- uses: actions/[email protected]
2040
id: gradle-cache
@@ -28,8 +48,49 @@ jobs:
2848
path: |
2949
~/.gradle/wrapper
3050
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
31-
- name: Build
32-
run: ./gradlew build
51+
- name: Build maproulette-java-client
52+
run: |
53+
pushd java-client
54+
./gradlew build
55+
56+
- name: Build maproulette2 sbt
57+
run: |
58+
pushd maproulette2
59+
sbt compile
60+
- name: Create the maproulette2 dev.conf
61+
run: |
62+
pushd maproulette2
63+
touch ./conf/dev.conf
64+
echo 'include "application.conf"' >> ./conf/dev.conf
65+
echo 'db.default {' >> ./conf/dev.conf
66+
echo ' url="jdbc:postgresql://localhost:5432/mr_test"' >> ./conf/dev.conf
67+
echo ' username="osm"' >> ./conf/dev.conf
68+
echo ' password="osm"' >> ./conf/dev.conf
69+
echo '}' >> ./conf/dev.conf
70+
echo 'maproulette {' >> ./conf/dev.conf
71+
echo ' debug=true' >> ./conf/dev.conf
72+
echo ' bootstrap=true' >> ./conf/dev.conf
73+
echo ' super.key="1234"' >> ./conf/dev.conf
74+
echo ' super.accounts=""' >> ./conf/dev.conf
75+
echo '}' >> ./conf/dev.conf
76+
- name: Run the integration tests
77+
env:
78+
SBT_OPTS: "-Xms512M -Xmx1024M -Xss2M -XX:MaxMetaspaceSize=1024M"
79+
API_HOST: 127.0.0.1:9000
80+
host: 127.0.0.1
81+
scheme: http
82+
apiKey: 1234
83+
run: |
84+
pushd maproulette2
85+
sbt -Dconfig.file=./conf/dev.conf run &
86+
sleep 15
87+
popd
88+
pushd java-client
89+
./gradlew --info --project-prop runIntegrationTests \
90+
clean integrationTest \
91+
--tests '*BatchUploaderIntegrationTest*' \
92+
--tests '*ChallengeAPIIntegrationTest*'
93+
3394
validation:
3495
name: "Gradle Validation"
3596
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)