Hideout/.github/workflows/pull-request-merge-check.yml

120 lines
2.8 KiB
YAML
Raw Normal View History

2023-11-30 11:04:30 +00:00
name: PullRequest Merge Check
on:
pull_request:
2024-08-10 03:18:52 +00:00
paths-ignore:
- 'owl/**'
branches:
- "develop"
types:
- opened # default
- reopened # default
- synchronize # default
- ready_for_review # 必要
2024-07-29 14:43:55 +00:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
id-token: write
pull-requests: write
jobs:
setup:
2023-11-30 11:04:30 +00:00
name: Setup
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
2024-07-29 14:43:55 +00:00
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
2024-07-29 14:43:55 +00:00
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
2024-07-29 14:43:55 +00:00
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
2024-07-29 14:43:55 +00:00
gradle-home-cache-cleanup: true
- name: Build
2024-07-29 15:06:09 +00:00
run: ./gradlew :hideout-core:classes
unit-test:
2023-11-30 11:04:30 +00:00
name: Unit Test
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
2024-07-29 15:06:09 +00:00
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
2024-07-29 15:06:09 +00:00
gradle-home-cache-cleanup: true
2024-07-29 15:06:09 +00:00
- name: Unit Test
run: ./gradlew :hideout-core:koverXmlReport
- name: Add coverage report to PR
if: always()
id: kover
uses: madrapps/jacoco-report@v1.6.1
with:
paths: |
2024-05-18 07:18:54 +00:00
${{ github.workspace }}/hideout-core/build/reports/kover/report.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: Code Coverage
update-comment: true
min-coverage-overall: 80
min-coverage-changed-files: 80
coverage-counter-type: LINE
- name: JUnit Test Report
uses: mikepenz/action-junit-report@v4
with:
report_paths: '**/TEST-*.xml'
lint:
2023-11-30 11:04:30 +00:00
name: Lint
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
2024-07-29 15:06:09 +00:00
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
2024-07-29 15:06:09 +00:00
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: ./gradlew :hideout-core:detektMain
- name: Auto Commit
if: ${{ always() }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: fix lint (CI)"