2023-11-30 11:04:30 +00:00
|
|
|
name: PullRequest Merge Check
|
|
|
|
|
2023-11-30 09:49:29 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
2024-08-10 03:18:52 +00:00
|
|
|
paths-ignore:
|
|
|
|
- 'owl/**'
|
2023-11-30 09:49:29 +00:00
|
|
|
branches:
|
|
|
|
- "develop"
|
2024-06-17 13:51:43 +00:00
|
|
|
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
|
2023-11-30 09:49:29 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
checks: write
|
|
|
|
id-token: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup:
|
2023-11-30 11:04:30 +00:00
|
|
|
name: Setup
|
2024-06-17 13:51:43 +00:00
|
|
|
if: github.event.pull_request.draft == false
|
2023-11-30 09:49:29 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 13:23:54 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
|
2024-07-29 14:43:55 +00:00
|
|
|
- name: Gradle Wrapper Validation
|
2024-08-03 23:11:59 +00:00
|
|
|
uses: gradle/actions/wrapper-validation@v4
|
2024-07-29 14:43:55 +00:00
|
|
|
|
2024-02-04 07:19:33 +00:00
|
|
|
- name: Set up JDK 21
|
2024-05-07 13:26:23 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2024-02-04 07:19:33 +00:00
|
|
|
java-version: '21'
|
2023-11-30 09:49:29 +00:00
|
|
|
distribution: 'temurin'
|
2024-07-29 14:43:55 +00:00
|
|
|
|
|
|
|
- name: Setup Gradle
|
2024-08-03 23:11:59 +00:00
|
|
|
uses: gradle/actions/setup-gradle@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2024-07-29 15:19:50 +00:00
|
|
|
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
|
2023-11-30 09:49:29 +00:00
|
|
|
|
|
|
|
unit-test:
|
2023-11-30 11:04:30 +00:00
|
|
|
name: Unit Test
|
2023-11-30 09:49:29 +00:00
|
|
|
needs: [ setup ]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 13:23:54 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
|
2024-02-04 07:19:33 +00:00
|
|
|
- name: Set up JDK 21
|
2024-05-07 13:26:23 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2024-02-04 07:19:33 +00:00
|
|
|
java-version: '21'
|
2023-11-30 09:49:29 +00:00
|
|
|
distribution: 'temurin'
|
|
|
|
|
2024-07-29 15:06:09 +00:00
|
|
|
- name: Setup Gradle
|
2024-08-03 23:11:59 +00:00
|
|
|
uses: gradle/actions/setup-gradle@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2024-07-29 15:19:50 +00:00
|
|
|
cache-read-only: false
|
2024-07-29 15:06:09 +00:00
|
|
|
gradle-home-cache-cleanup: true
|
2024-06-29 02:44:25 +00:00
|
|
|
|
2024-07-29 15:06:09 +00:00
|
|
|
- name: Unit Test
|
2024-07-29 15:09:46 +00:00
|
|
|
run: ./gradlew :hideout-core:koverXmlReport
|
2023-11-30 09:49:29 +00:00
|
|
|
|
|
|
|
- name: Add coverage report to PR
|
|
|
|
if: always()
|
|
|
|
id: kover
|
2023-12-14 07:20:10 +00:00
|
|
|
uses: madrapps/jacoco-report@v1.6.1
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2023-12-14 07:24:50 +00:00
|
|
|
paths: |
|
2024-05-18 07:18:54 +00:00
|
|
|
${{ github.workspace }}/hideout-core/build/reports/kover/report.xml
|
2023-11-30 09:49:29 +00:00
|
|
|
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
|
2024-05-06 14:03:47 +00:00
|
|
|
uses: mikepenz/action-junit-report@v4
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2023-11-30 10:35:39 +00:00
|
|
|
report_paths: '**/TEST-*.xml'
|
|
|
|
|
|
|
|
lint:
|
2023-11-30 11:04:30 +00:00
|
|
|
name: Lint
|
2023-11-30 10:35:39 +00:00
|
|
|
needs: [ setup ]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 13:23:54 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-11-30 10:35:39 +00:00
|
|
|
|
2024-02-04 07:19:33 +00:00
|
|
|
- name: Set up JDK 21
|
2024-05-07 13:26:23 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-11-30 10:35:39 +00:00
|
|
|
with:
|
2024-02-04 07:19:33 +00:00
|
|
|
java-version: '21'
|
2023-11-30 10:35:39 +00:00
|
|
|
distribution: 'temurin'
|
|
|
|
|
2024-07-29 15:06:09 +00:00
|
|
|
- name: Setup Gradle
|
2024-08-03 23:11:59 +00:00
|
|
|
uses: gradle/actions/setup-gradle@v4
|
2023-11-30 10:35:39 +00:00
|
|
|
with:
|
2024-07-29 15:19:50 +00:00
|
|
|
cache-read-only: false
|
2024-07-29 15:06:09 +00:00
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Build with Gradle
|
2024-07-29 15:09:46 +00:00
|
|
|
run: ./gradlew :hideout-core:detektMain
|
2023-11-30 10:35:39 +00:00
|
|
|
|
2024-06-17 13:31:22 +00:00
|
|
|
- name: Auto Commit
|
2023-11-30 10:35:39 +00:00
|
|
|
if: ${{ always() }}
|
2024-06-17 13:31:22 +00:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
2023-11-30 10:35:39 +00:00
|
|
|
with:
|
2024-06-17 13:31:22 +00:00
|
|
|
commit_message: "style: fix lint (CI)"
|