name: "Unit Test" run-name: "Test projects using Unit Test framework to ensure code quality" on: [workflow_call] jobs: build-tests: name: "Build project tests" runs-on: ubuntu-latest steps: - name: "Setup cached built project" uses: actions/cache/restore@v4 with: path: "./" key: ${{ runner.os }}-build-${{ github.sha }} fail-on-cache-miss: 'true' - name: "Setup Java 21" uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' cache: sbt - name: "Setup sbt" uses: sbt/setup-sbt@v1 - name: "Compile unit tests" run: sbt 'Test / compile' - name: "Cache compiled unit tests" uses: actions/cache/save@v4 with: path: "./" key: ${{ runner.os }}-build-${{ github.sha }}-withTests unit-test-morny-system-lib: name: "Run unit-test for morny-system-lib" needs: [build-tests] runs-on: ubuntu-latest steps: - name: "Setup cached built project" uses: actions/cache/restore@v4 with: path: "./" key: ${{ runner.os }}-build-${{ github.sha }}-withTests fail-on-cache-miss: 'true' - name: "Setup Java 21" uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' cache: sbt - name: "Setup sbt" uses: sbt/setup-sbt@v1 - name: "Run unit tests" continue-on-error: true run: sbt 'morny_system_lib / test' - name: "Upload test reports as artifact" uses: actions/upload-artifact@v4 continue-on-error: true with: name: 'unit-test-report_morny-system-lib' path: ./morny-system-lib/target/test-reports/* - name: "Publish test report to summary" uses: phoenix-actions/test-reporting@v15 with: output-to: 'step-summary' name: 'Unit Tests Report' path: ./morny-system-lib/target/test-reports/*.xml reporter: 'java-junit' unit-test-morny-core: name: "Run unit-test for morny-core" needs: [build-tests] runs-on: ubuntu-latest steps: - name: "Setup cached built project" uses: actions/cache/restore@v4 with: path: "./" key: ${{ runner.os }}-build-${{ github.sha }}-withTests fail-on-cache-miss: 'true' - name: "Setup Java 21" uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' cache: sbt - name: "Setup sbt" uses: sbt/setup-sbt@v1 - name: "Run unit tests" continue-on-error: true run: sbt 'morny_core / test' - name: "Upload test reports as artifact" uses: actions/upload-artifact@v4 continue-on-error: true with: name: 'unit-test-report_morny-core' path: ./morny-core/target/test-reports/* - name: "Publish test report to summary" uses: phoenix-actions/test-reporting@v15 with: output-to: 'step-summary' name: 'Unit Tests Report' path: ./morny-core/target/test-reports/*.xml reporter: 'java-junit' unit-test-morny-coeur: name: "Run unit-test for morny-coeur" needs: [build-tests] runs-on: ubuntu-latest steps: - name: "Setup cached built project" uses: actions/cache/restore@v4 with: path: "./" key: ${{ runner.os }}-build-${{ github.sha }}-withTests fail-on-cache-miss: 'true' - name: "Setup Java 21" uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' cache: sbt - name: "Setup sbt" uses: sbt/setup-sbt@v1 - name: "Run unit tests" continue-on-error: true run: sbt 'morny_coeur / test' - name: "Upload test reports as artifact" uses: actions/upload-artifact@v4 continue-on-error: true with: name: 'unit-test-report_morny-coeur' path: ./morny-coeur/target/test-reports/* - name: "Publish test report to summary" uses: phoenix-actions/test-reporting@v15 with: output-to: 'step-summary' name: 'Unit Tests Report' path: ./morny-coeur/target/test-reports/*.xml reporter: 'java-junit'