mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fix tests
This commit is contained in:
Vendored
-28
@@ -1,28 +0,0 @@
|
|||||||
name: Test Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
path: diy-layout-creator
|
|
||||||
|
|
||||||
- name: Set up JDK 17
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'temurin'
|
|
||||||
cache: maven
|
|
||||||
|
|
||||||
- name: Build with Maven
|
|
||||||
working-directory: ./diy-layout-creator/diylc
|
|
||||||
run: mvn -B test
|
|
||||||
Vendored
+15
-40
@@ -1,51 +1,26 @@
|
|||||||
name: Java CI Tests
|
name: Test Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ "master" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ "master" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '11' # Adjust version as needed
|
java-version: '17'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Build with Maven
|
||||||
run: mvn test
|
working-directory: ./diylc
|
||||||
|
run: mvn -B test
|
||||||
# Generate and report coverage without failing
|
|
||||||
- name: Generate Coverage Report
|
|
||||||
run: mvn jacoco:report
|
|
||||||
|
|
||||||
- name: Report Coverage
|
|
||||||
run: |
|
|
||||||
COVERAGE=$(mvn jacoco:report | grep -oP 'Total coverage: \K[0-9.]+' || echo "unknown")
|
|
||||||
echo "Current test coverage: $COVERAGE%"
|
|
||||||
|
|
||||||
- name: Upload Coverage Report
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: coverage-report
|
|
||||||
path: target/site/jacoco/
|
|
||||||
|
|
||||||
# Optional: Comment test results on PR
|
|
||||||
- name: Add Test Results Comment
|
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
with:
|
|
||||||
message: |
|
|
||||||
### Test Results Summary
|
|
||||||
✅ Tests completed
|
|
||||||
📊 Coverage: ${{ env.COVERAGE }}%
|
|
||||||
|
|
||||||
Coverage report available in workflow artifacts
|
|
||||||
|
|||||||
Reference in New Issue
Block a user