|
1 | | -name: Pull Request Build |
2 | | -on: [pull_request] |
| 1 | +name: CI Build |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + |
3 | 6 | jobs: |
4 | 7 | build: |
5 | 8 | 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 | + |
6 | 19 | strategy: |
7 | 20 | matrix: |
8 | 21 | # Jdk 17 requires gradle 7.3+ https://docs.gradle.org/current/userguide/compatibility.html |
9 | 22 | java: [11] |
| 23 | + |
10 | 24 | 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 |
12 | 30 | with: |
| 31 | + repository: 'maproulette/maproulette2' |
| 32 | + path: 'maproulette2' |
13 | 33 | fetch-depth: 0 |
14 | 34 | - name: Set up JDK ${{ matrix.java }} |
15 | 35 | uses: actions/setup-java@v2 |
16 | 36 | with: |
17 | | - distribution: 'zulu' |
| 37 | + distribution: 'temurin' |
18 | 38 | java-version: ${{ matrix.java }} |
19 | 39 | |
20 | 40 | id: gradle-cache |
|
28 | 48 | path: | |
29 | 49 | ~/.gradle/wrapper |
30 | 50 | 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 | +
|
33 | 94 | validation: |
34 | 95 | name: "Gradle Validation" |
35 | 96 | runs-on: ubuntu-latest |
|
0 commit comments