mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2025-02-23 06:38:48 +08:00
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: "Unit Test"
|
|
run-name: "Test projects using Unit Test framework to ensure code quality"
|
|
on: [workflow_call]
|
|
jobs:
|
|
build:
|
|
uses: ./.github/workflows/build.yml
|
|
unit-test:
|
|
needs: [build]
|
|
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: "Run unit tests"
|
|
id: do-unit-test
|
|
continue-on-error: true
|
|
run: sbt test
|
|
- name: "Upload test reports as artifact"
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: 'unit-test-report'
|
|
path: ./*/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: ./*/target/test-reports/*.xml
|
|
reporter: 'java-junit'
|