Skip to content

Commit 9fd340c

Browse files
committed
OGM-1591 Tests with a remote MongoDb on GitHub
1 parent c0b7da2 commit 9fd340c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build.yml

+42
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,45 @@ jobs:
5656
name: reports-db-ogm
5757
path: './**/build/reports/'
5858
retention-days: 7
59+
60+
test_remote_mongodb:
61+
name: Test remote mongodb instance
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout default branch
65+
uses: actions/checkout@v2
66+
- name: Get year/month for cache key
67+
id: get-date
68+
run: |
69+
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
70+
shell: bash
71+
- name: Set up JDK 8
72+
uses: actions/[email protected]
73+
with:
74+
distribution: 'temurin'
75+
java-version: 8
76+
# https://github.com/actions/cache/blob/main/examples.md#java---maven
77+
- name: Cache local Maven repository
78+
uses: actions/cache@v4
79+
with:
80+
path: ~/.m2/repository
81+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
82+
restore-keys: |
83+
${{ runner.os }}-maven-
84+
- name: Set up Maven
85+
run: ./mvnw -v
86+
- name: Start MongoDB
87+
uses: supercharge/[email protected]
88+
with:
89+
mongodb-version: 3.6.23
90+
mongodb-port: 27017
91+
- name: Run tests
92+
run: |
93+
./mvnw verify -pl mongodb -s settings-example.xml -DuseExternalMongoDb -am
94+
- name: Upload build reports (if build failed)
95+
uses: actions/upload-artifact@v4
96+
if: ${{ failure() || cancelled() }}
97+
with:
98+
name: reports-db-ogm
99+
path: './**/build/reports/'
100+
retention-days: 7

0 commit comments

Comments
 (0)