Skip to content

Commit 2abbcad

Browse files
authored
fix mongo-setup in maven-verify (#24)
* maven-verify mongo shell command depends on mongo version * change default db-version from 5 to 8 in maven-verify * add test-maven-verify.yml with minimal pom.xml
1 parent 3dfb85d commit 2abbcad

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

.github/workflows/maven-verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ on:
4949
required: false
5050
type: number
5151
db-version:
52-
default: 5
52+
default: 8
5353
required: false
5454
type: number
5555

@@ -88,7 +88,7 @@ jobs:
8888
- name: Check MongoDB
8989
if: inputs.db-type == 'mongodb'
9090
run: |
91-
mongo --eval "db.version()"
91+
${{ inputs.db-version < 6 && 'mongo' || 'mongosh' }} --eval "db.version()"
9292
9393
- # https://github.com/actions/setup-java
9494
name: Setup Java
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: test-maven-verify.yml
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
strategy:
16+
matrix:
17+
java:
18+
- 17
19+
- 21
20+
db:
21+
- type: mongodb
22+
name: '' # not used for mongo
23+
username: '' # not used for mongo
24+
password: '' # not used for mongo
25+
port: 0 # not used for mongo
26+
version: 8
27+
- type: postgresql
28+
name: 'test'
29+
username: 'test'
30+
password: 'test'
31+
port: 5432
32+
version: 0 # not used for postgres
33+
uses: ./.github/workflows/maven-verify.yml
34+
with:
35+
runner: ubuntu-24.04
36+
java-version: ${{ matrix.java }}
37+
db-type: ${{ matrix.db.type }}
38+
db-name: ${{ matrix.db.name }}
39+
db-username: ${{ matrix.db.username }}
40+
db-password: ${{ matrix.db.password }}
41+
db-port: ${{ matrix.db.port }}
42+
db-version: ${{ matrix.db.version }}

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- This is a minimal pom file, just for testing purposes. -->
2+
<!-- https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Minimal_POM -->
3+
<project>
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>org.fairdatateam.test</groupId>
6+
<artifactId>test-maven-verify-workflow</artifactId>
7+
<version>1</version>
8+
</project>

0 commit comments

Comments
 (0)