GitHub CI with maven testing not running any tests

I’m an absolute newbie to CI and GitHub, and especially the combination of the two. I have a group project where we use maven for building, maven surefire with junit 5 for testing. We have a couple of tests that run just fine locally, but no config of our maven.yml the repo doesn’t run these tests. Here’s the current iteration of the .yml (all the currently commented lines are ones that we tested):

name: Java CI with Maven
    branches: [ main ]
    branches: [ main ]


    runs-on: ubuntu-latest

    - uses: actions/[email protected]
    - name: Set up JDK 1.8
      uses: actions/[email protected]
        java-version: 1.8
    - name: Build with Maven
      #run: mvn -B package --file pom.xml
      run: mvn --batch-mode --update-snapshots verify
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test
    #- name: Test with Maven
      #run:  mvn -Dtest="test/*Test" test
      #run: mvn '-Dtest=test.*Test' test

and here’s our current pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""



Using this and the default “test” lifecycle from Intellij’s maven integration, all our tests are ran locally. (The intellij maven test lifecycle uses the following line for testing to my knowledge: test -f pom.xml). However when we try this on GitHub using our CI configuration it says that no tests were found in the default test:

[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ Izsakazsivany ---
[INFO] No tests to run.

(side note: izsakazsivany is our project name side note2: there are about 100 lines of downloads between the 2 above lines)

What is causing this discrepancy between the local version and the one on GitHub, how come it’s not seeing the tests when the same mvn commands are ran?

Edit: This may be an important specification our tests are in a package called test and in specific packages for the separate classes that are tested. Example: git/src/main/test/entity


Issue is resolved finally, the issue was with a bad project structure and we needed to add a line to pom.xml detailing where the tests can be found. <testSourceDirectory>src/main/test/java/com/team</testSourceDirectory>

Edit: The issue most likely had to do with bad project structure, as our tests folder was to deep down. By extension this also meant that our package names also had to be redone. Advice: make sure your project structure is correct at the very start to avoid issues like this.