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

129 lines
3.1 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
with:
token: ${{ secrets.PAT }}
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
run: ./gradlew classes --no-daemon
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
with:
token: ${{ secrets.PAT }}
- 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
2024-08-13 11:11:00 +00:00
run: ./hideout-core/gradlew :hideout-core:koverXmlReport
- name: Add coverage report to PR
if: always()
id: kover
uses: madrapps/jacoco-report@v1.7.0
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
2024-08-13 11:11:00 +00:00
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
2024-08-13 11:11:00 +00:00
with:
ref: ${{ github.head_ref }}
token: '${{ secrets.PAT }}'
- 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 :hideout-mastodon:detektMain
- name: Auto Commit
if: ${{ always() }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: fix lint (CI)"