mirror of https://github.com/usbharu/Hideout.git
118 lines
2.8 KiB
YAML
118 lines
2.8 KiB
YAML
name: PullRequest Merge Check
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "develop"
|
|
types:
|
|
- opened # default
|
|
- reopened # default
|
|
- synchronize # default
|
|
- ready_for_review # 必要
|
|
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:
|
|
name: Setup
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Gradle Wrapper Validation
|
|
uses: gradle/actions/wrapper-validation@v3
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
with:
|
|
cache-read-only: false
|
|
gradle-home-cache-cleanup: true
|
|
|
|
- name: Build
|
|
run: ./gradlew :hideout-core:classes
|
|
|
|
unit-test:
|
|
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'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
with:
|
|
cache-read-only: false
|
|
gradle-home-cache-cleanup: true
|
|
|
|
- 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: |
|
|
${{ 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:
|
|
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'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
with:
|
|
cache-read-only: false
|
|
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)" |