Skip to content

Commit

Permalink
chore: Add configuration for release-drafter workflow (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc authored Dec 18, 2024
1 parent 6b0449f commit 159d650
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:
merge_group:

permissions: write-all

jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -20,44 +22,36 @@ jobs:
include:
- { java-version: "11", os: "windows-latest", os-label: "Windows" }
- { java-version: "11", os: "macos-latest", os-label: "macOS" }

steps:
- uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'maven'

- name: Code style check
run: mvn spotless:check

- name: Build and Test with Coverage
run: |
mvn -pl api clean test-compile
mvn -pl api test jacoco:report
- name: Debug Test Results (Unix)
if: runner.os != 'Windows'
run: |
echo "Test Results:"
find . -name "TEST-*.xml" -exec cat {} \;
echo "JaCoCo Report Location:"
ls -la api/target/site/jacoco/
- name: Debug Test Results (Windows)
if: runner.os == 'Windows'
run: |
echo "Test Results:"
Get-ChildItem -Recurse -Filter "TEST-*.xml" | Get-Content
echo "JaCoCo Report Location:"
Get-ChildItem -Path "api\target\site\jacoco" -Force
- name: Generate JaCoCo Report
run: mvn -pl api jacoco:report

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand All @@ -73,4 +67,30 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
${{ runner.os }}-m2-
test_success:
# this aggregates success state of all jobs listed in `needs`
# this is the only required check to pass CI
name: "Test success"
if: always()
runs-on: ubuntu-latest
needs: [ test ]
steps:
- name: "Success"
if: needs.test.result == 'success'
run: true
shell: bash
- name: "Failure"
if: needs.test.result != 'success'
run: false
shell: bash

draft:
runs-on: ubuntu-latest
needs: test_success
if: github.ref == 'refs/heads/main'
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 159d650

Please sign in to comment.