name: maven-build-with-dry-run-for-tests
description: maven-build-with-dry-run-for-tests
runs:
  using: "composite"
  steps:

    - name: run 'install' on the project
      shell: bash
      run: |
        ./mvnw install -B  \
              -Dspring-boot.build-image.skip=true \
              -DskipTests -DskipITs \
              -T 1C -U -q

    - name: find all classpath entries
      shell: bash
      run: |
        ./mvnw -q exec:exec -Dexec.classpathScope="test" -Dexec.executable="echo" -Dexec.args="%classpath" | tr : "\n" > /tmp/deps.txt

    - name: find all tests
      shell: bash
      run: |
        cd spring-cloud-kubernetes-test-support
        .././mvnw -q exec:java -Prun-on-github-actions -Dexec.mainClass="org.springframework.cloud.kubernetes.tests.discovery.TestsDiscovery" > /tmp/tests.txt
        cd ..

    - name: show result
      if: always()
      shell: bash
      run: cat /tmp/tests.txt

    - name: upload test
      uses: actions/upload-artifact@v4
      with:
        name: tests.txt
        path: /tmp/tests.txt

