2024-09-16 13:51:46 +00:00
|
|
|
name: pull-request-merge-check.yml
|
2023-11-30 09:49:29 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "develop"
|
2024-06-17 13:51:43 +00:00
|
|
|
types:
|
2024-09-16 13:51:46 +00:00
|
|
|
- opened
|
|
|
|
- reopened
|
|
|
|
- synchronize
|
|
|
|
- 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
|
|
|
|
2024-09-16 14:17:56 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
checks: write
|
|
|
|
id-token: write
|
|
|
|
pull-requests: write
|
|
|
|
|
2023-11-30 09:49:29 +00:00
|
|
|
jobs:
|
2024-09-16 13:51:46 +00:00
|
|
|
change:
|
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
|
2024-09-16 13:51:46 +00:00
|
|
|
outputs:
|
|
|
|
core: ${{ steps.filter.outputs.core }}
|
2024-09-16 14:42:34 +00:00
|
|
|
mastodon: ${{ steps.filter.outputs.mastodon }}
|
2024-09-16 13:51:46 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.PAT }}
|
|
|
|
|
|
|
|
- name: Check Changes
|
|
|
|
uses: dorny/paths-filter@v2
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
core:
|
|
|
|
- 'hideout-core/**'
|
|
|
|
- 'libs.versions.toml'
|
|
|
|
ap:
|
|
|
|
- 'hideout-activitypub/**'
|
|
|
|
- 'libs.versions.toml'
|
|
|
|
mastodon:
|
|
|
|
- 'hideout-mastodon/**'
|
|
|
|
- 'libs.versions.toml'
|
|
|
|
owl:
|
|
|
|
- 'owl/**'
|
|
|
|
- 'libs.versions.toml'
|
|
|
|
|
|
|
|
hideout-core-setup:
|
|
|
|
needs:
|
|
|
|
- change
|
|
|
|
if: github.event.pull_request.draft == false && needs.change.outputs.core == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
2023-11-30 09:49:29 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 13:23:54 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-08-26 06:47:22 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.PAT }}
|
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-09-16 14:39:12 +00:00
|
|
|
run: ./gradlew :hideout-core:classes --no-daemon
|
|
|
|
|
|
|
|
hideout-mastodon-setup:
|
|
|
|
needs:
|
|
|
|
- change
|
|
|
|
if: github.event.pull_request.draft == false && needs.change.outputs.mastodon == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.PAT }}
|
|
|
|
|
|
|
|
- name: Gradle Wrapper Validation
|
|
|
|
uses: gradle/actions/wrapper-validation@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@v4
|
|
|
|
with:
|
|
|
|
cache-read-only: false
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: ./gradlew :hideout-mastodon:classes --no-daemon
|
2023-11-30 09:49:29 +00:00
|
|
|
|
2024-09-16 13:51:46 +00:00
|
|
|
hideout-core-unit-test:
|
|
|
|
needs:
|
|
|
|
- hideout-core-setup
|
|
|
|
- change
|
|
|
|
if: github.event.pull_request.draft == false && needs.change.outputs.core == 'true'
|
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
|
2024-08-26 06:47:22 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.PAT }}
|
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-08-13 11:11:00 +00:00
|
|
|
run: ./hideout-core/gradlew :hideout-core:koverXmlReport
|
2023-11-30 09:49:29 +00:00
|
|
|
|
2024-09-16 13:51:46 +00:00
|
|
|
- name: JUnit Test Report
|
|
|
|
uses: mikepenz/action-junit-report@v4
|
|
|
|
with:
|
|
|
|
report_paths: '**/TEST-*.xml'
|
|
|
|
check_name: 'hideout-core JUnit Test Report'
|
|
|
|
|
|
|
|
- name: Upload Coverage Report
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: 'hideout-core.xml'
|
|
|
|
path: 'hideout-core/build/reports/kover/hideout-core.xml'
|
|
|
|
|
2024-09-16 14:39:12 +00:00
|
|
|
|
|
|
|
hideout-mastodon-unit-test:
|
|
|
|
needs:
|
|
|
|
- hideout-mastodon-setup
|
|
|
|
- change
|
|
|
|
if: github.event.pull_request.draft == false && needs.change.outputs.mastodon == 'true'
|
|
|
|
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'
|
|
|
|
|
|
|
|
- name: Setup Gradle
|
|
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
with:
|
|
|
|
cache-read-only: false
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Unit Test
|
|
|
|
run: ./hideout-mastodon/gradlew :hideout-mastodon:koverXmlReport
|
|
|
|
|
|
|
|
- name: JUnit Test Report
|
|
|
|
uses: mikepenz/action-junit-report@v4
|
|
|
|
with:
|
|
|
|
report_paths: '**/TEST-*.xml'
|
2024-09-16 14:56:38 +00:00
|
|
|
check_name: 'hideout-mastodon JUnit Test Report'
|
2024-09-16 14:39:12 +00:00
|
|
|
|
|
|
|
- name: Upload Coverage Report
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-09-16 14:56:38 +00:00
|
|
|
name: 'hideout-mastodon.xml'
|
2024-09-16 15:12:37 +00:00
|
|
|
path: 'hideout-mastodon/build/reports/kover/hideout-mastodon.xml'
|
2024-09-16 14:39:12 +00:00
|
|
|
|
2024-09-16 13:51:46 +00:00
|
|
|
coverage:
|
|
|
|
needs:
|
|
|
|
- change
|
|
|
|
- hideout-core-unit-test
|
2024-09-16 14:39:12 +00:00
|
|
|
- hideout-mastodon-unit-test
|
2024-09-16 13:51:46 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download Coverage Report
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
2024-09-16 15:49:27 +00:00
|
|
|
path: 'hideout-core/build/reports/kover'
|
2024-09-16 15:33:36 +00:00
|
|
|
|
2024-09-16 13:51:46 +00:00
|
|
|
- name: Report Coverage
|
2024-08-30 20:05:43 +00:00
|
|
|
uses: madrapps/jacoco-report@v1.7.0
|
2023-11-30 09:49:29 +00:00
|
|
|
with:
|
2023-12-14 07:24:50 +00:00
|
|
|
paths: |
|
2024-09-16 16:37:19 +00:00
|
|
|
${{ github.workspace }}/hideout-core/build/reports/kover/hideout-core.xml/hideout-core.xml,
|
|
|
|
${{ github.workspace }}/hideout-core/build/reports/kover/hideout-mastodon.xml/hideout-mastodon.xml
|
2023-11-30 09:49:29 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
title: Code Coverage
|
|
|
|
update-comment: true
|
2024-09-15 14:01:42 +00:00
|
|
|
min-coverage-overall: 50
|
2023-11-30 09:49:29 +00:00
|
|
|
min-coverage-changed-files: 80
|
|
|
|
|
2023-11-30 10:35:39 +00:00
|
|
|
lint:
|
2024-09-16 13:51:46 +00:00
|
|
|
needs:
|
|
|
|
- change
|
|
|
|
- hideout-core-setup
|
2024-09-16 14:39:12 +00:00
|
|
|
- hideout-mastodon-setup
|
2023-11-30 10:35:39 +00:00
|
|
|
runs-on: ubuntu-latest
|
2024-08-13 11:11:00 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2023-11-30 10:35:39 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 13:23:54 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-08-13 11:11:00 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.head_ref }}
|
2024-09-16 13:51:46 +00:00
|
|
|
token: ${{ secrets.PAT }}
|
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
|
|
|
|
|
2024-09-16 13:51:46 +00:00
|
|
|
- name: Lint
|
2024-08-23 15:11:54 +00:00
|
|
|
run: ./gradlew :hideout-core:detektMain :hideout-mastodon: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)"
|