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
|
name: assembly-run.yml
|
||||||
on: [workflow_call]
|
on: [workflow_call]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
|
||||||
uses: ./.github/workflows/build.yml
|
|
||||||
assembly:
|
assembly:
|
||||||
needs: [build]
|
name: "Build assembly jar"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Setup cached built project"
|
- name: "Setup cached built project"
|
||||||
@ -26,5 +24,5 @@ jobs:
|
|||||||
- name: "Publish assembly jar"
|
- name: "Publish assembly jar"
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: 'assembly-jar'
|
name: 'assembly'
|
||||||
path: ./morny-coeur/target/*-assembly-*.jar
|
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]
|
on: [workflow_call]
|
||||||
jobs:
|
jobs:
|
||||||
generate-assembly:
|
generate-assembly:
|
||||||
|
name: "Build assembly jar"
|
||||||
uses: ./.github/workflows/assembly-generate.yml
|
uses: ./.github/workflows/assembly-generate.yml
|
||||||
run-assembly:
|
run-assembly:
|
||||||
|
name: "Test run assembly jar"
|
||||||
needs: [generate-assembly]
|
needs: [generate-assembly]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Setup assembly jar from artifacts"
|
- name: "Setup assembly jar from artifacts"
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: 'assembly-jar'
|
name: 'assembly'
|
||||||
path: ./assembles/
|
path: ./assembles/
|
||||||
- name: "Setup Java 21"
|
- name: "Setup Java 21"
|
||||||
uses: actions/setup-java@v4
|
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]
|
on: [workflow_call]
|
||||||
jobs:
|
jobs:
|
||||||
compile:
|
compile:
|
||||||
|
name: "Compile Project"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Check if there's already have cache"
|
- 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]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
check-build:
|
check-build:
|
||||||
|
name: "Do project compile"
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
check-unit-tests:
|
check-unit-tests:
|
||||||
|
name: "Do unit tests"
|
||||||
needs: [check-build]
|
needs: [check-build]
|
||||||
uses: ./.github/workflows/unit-test.yml
|
uses: ./.github/workflows/unit-test.yml
|
||||||
check-assembly-run:
|
check-assembly-run:
|
||||||
|
name: "Generate and test run assembly"
|
||||||
needs: [check-build]
|
needs: [check-build]
|
||||||
uses: ./.github/workflows/assembly-run.yml
|
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"
|
run-name: "Test projects using Unit Test framework to ensure code quality"
|
||||||
on: [workflow_call]
|
on: [workflow_call]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-tests:
|
||||||
uses: ./.github/workflows/build.yml
|
name: "Build project tests"
|
||||||
unit-test:
|
|
||||||
needs: [build]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Setup cached built project"
|
- name: "Setup cached built project"
|
||||||
@ -22,19 +20,115 @@ jobs:
|
|||||||
cache: sbt
|
cache: sbt
|
||||||
- name: "Setup sbt"
|
- name: "Setup sbt"
|
||||||
uses: sbt/setup-sbt@v1
|
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"
|
- name: "Run unit tests"
|
||||||
id: do-unit-test
|
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: sbt test
|
run: sbt 'morny_system_lib / test'
|
||||||
- name: "Upload test reports as artifact"
|
- name: "Upload test reports as artifact"
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: 'unit-test-report'
|
name: 'unit-test-report_morny-system-lib'
|
||||||
path: ./*/target/test-reports/*
|
path: ./morny-system-lib/target/test-reports/*
|
||||||
- name: "Publish test report to summary"
|
- name: "Publish test report to summary"
|
||||||
uses: phoenix-actions/test-reporting@v15
|
uses: phoenix-actions/test-reporting@v15
|
||||||
with:
|
with:
|
||||||
output-to: 'step-summary'
|
output-to: 'step-summary'
|
||||||
name: 'Unit Tests Report'
|
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'
|
reporter: 'java-junit'
|
||||||
|
Loading…
Reference in New Issue
Block a user