mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2025-04-29 09:32:04 +08:00
Suqash merge: Separate unit tests
commit 3b24ff6d15aa3671176629ca86ef1c34cd56d6cd Author: Eyre_S <sukazyo@outlook.com> Date: Thu Feb 27 19:04:30 2025 +0800 fix assembly run error commit 5dbad550ba3bc09c1c8d7ce4863d8d2dabf2c56d Author: Eyre_S <sukazyo@outlook.com> Date: Thu Feb 27 19:01:38 2025 +0800 fix artifact conflict commit 377140f225803138f404b89d77f0becdb2c6e912 Author: Eyre_S <sukazyo@outlook.com> Date: Thu Feb 27 18:56:08 2025 +0800 separate unit tests, remove unnecessary compile, add names
This commit is contained in:
parent
bd63567e8a
commit
3dd701cbef
6
.github/workflows/assembly-generate.yml
vendored
6
.github/workflows/assembly-generate.yml
vendored
@ -1,10 +1,8 @@
|
||||
name: assembly-run.yml
|
||||
on: [workflow_call]
|
||||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/build.yml
|
||||
assembly:
|
||||
needs: [build]
|
||||
name: "Build assembly jar"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Setup cached built project"
|
||||
@ -26,5 +24,5 @@ jobs:
|
||||
- name: "Publish assembly jar"
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'assembly-jar'
|
||||
name: 'assembly'
|
||||
path: ./morny-coeur/target/*-assembly-*.jar
|
||||
|
4
.github/workflows/assembly-run.yml
vendored
4
.github/workflows/assembly-run.yml
vendored
@ -2,15 +2,17 @@ name: assembly-run.yml
|
||||
on: [workflow_call]
|
||||
jobs:
|
||||
generate-assembly:
|
||||
name: "Build assembly jar"
|
||||
uses: ./.github/workflows/assembly-generate.yml
|
||||
run-assembly:
|
||||
name: "Test run assembly jar"
|
||||
needs: [generate-assembly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Setup assembly jar from artifacts"
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: 'assembly-jar'
|
||||
name: 'assembly'
|
||||
path: ./assembles/
|
||||
- name: "Setup Java 21"
|
||||
uses: actions/setup-java@v4
|
||||
|
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@ -3,6 +3,7 @@ run-name: "Build projects to ensure compiling is successful"
|
||||
on: [workflow_call]
|
||||
jobs:
|
||||
compile:
|
||||
name: "Compile Project"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Check if there's already have cache"
|
||||
|
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@ -2,10 +2,13 @@ name: Tests
|
||||
on: [push]
|
||||
jobs:
|
||||
check-build:
|
||||
name: "Do project compile"
|
||||
uses: ./.github/workflows/build.yml
|
||||
check-unit-tests:
|
||||
name: "Do unit tests"
|
||||
needs: [check-build]
|
||||
uses: ./.github/workflows/unit-test.yml
|
||||
check-assembly-run:
|
||||
name: "Generate and test run assembly"
|
||||
needs: [check-build]
|
||||
uses: ./.github/workflows/assembly-run.yml
|
||||
|
112
.github/workflows/unit-test.yml
vendored
112
.github/workflows/unit-test.yml
vendored
@ -2,10 +2,8 @@ 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]
|
||||
build-tests:
|
||||
name: "Build project tests"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Setup cached built project"
|
||||
@ -22,19 +20,115 @@ jobs:
|
||||
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"
|
||||
id: do-unit-test
|
||||
continue-on-error: true
|
||||
run: sbt test
|
||||
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'
|
||||
path: ./*/target/test-reports/*
|
||||
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: ./*/target/test-reports/*.xml
|
||||
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'
|
||||
|
Loading…
Reference in New Issue
Block a user