From ad9c29209a8c45d9b2b711d2a302196a4c82365e Mon Sep 17 00:00:00 2001 From: matejsemancik Date: Mon, 20 Nov 2023 18:58:52 +0100 Subject: [PATCH] Update workflows for composite build, remove Danger --- .../workflows/gradle-wrapper-validation.yml | 2 +- .github/workflows/pr-check.yml | 15 ++-------- .github/workflows/publish.yml | 2 +- Dangerfile | 28 ------------------- Gemfile | 7 ----- config/detekt.yml | 2 +- plugin-build/gradle/libs.versions.toml | 14 ---------- plugin-build/plugin/build.gradle.kts | 2 +- plugin-build/settings.gradle.kts | 8 +++++- 9 files changed, 14 insertions(+), 66 deletions(-) delete mode 100644 Dangerfile delete mode 100644 Gemfile delete mode 100644 plugin-build/gradle/libs.versions.toml diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index aa6c8b9..bafb330 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -9,7 +9,7 @@ on: jobs: validation: - name: Validation + name: Gradle Wrapper Validation runs-on: ubuntu-latest steps: - name: Checkout latest code diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 4e11ce9..977ef65 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -9,20 +9,11 @@ concurrency: cancel-in-progress: true jobs: - validation: - name: Validation + check: + name: Check runs-on: ubuntu-latest steps: - name: Checkout latest code uses: actions/checkout@v4 - name: Run check - run: ./gradlew check - - name: Danger Report - uses: MeilCli/danger-action@v2 - continue-on-error: true - with: - plugins_file: 'Gemfile' - danger_file: 'Dangerfile' - danger_id: 'danger-pr' - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} + run: ./gradlew --project-dir plugin-build check \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 72bb25b..ecd5b61 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Run check - run: ./gradlew check + run: ./gradlew --project-dir plugin-build check - name: Publish on Plugin Portal run: ./gradlew --project-dir plugin-build setupPublishSecrets publishPlugins if: success() diff --git a/Dangerfile b/Dangerfile deleted file mode 100644 index 58831e7..0000000 --- a/Dangerfile +++ /dev/null @@ -1,28 +0,0 @@ -danger.import_dangerfile(github: "futuredapp/danger") - -def report_checkstyle(file_name) - if File.file?(file_name) - checkstyle_format.report file_name - end -end - -def report_all_ktlint_results(file_name) - # Get the absolute path of the current directory - current_directory = Dir.pwd - - # Recursively search for files in the current directory hierarchy - # and call the report function for files matching the given file name - Dir.glob("**/#{file_name}", File::FNM_PATHNAME | File::FNM_DOTMATCH) do |file_path| - report_checkstyle(file_path) - end -end - -# Setup checkstyle -checkstyle_format.base_path = Dir.pwd - -# Detekt report -report_checkstyle 'plugin/build/reports/detekt/detekt.xml' - -# Ktlint report -report_all_ktlint_results 'ktlintKotlinScriptCheck.xml' -report_all_ktlint_results 'ktlintMainSourceSetCheck.xml' diff --git a/Gemfile b/Gemfile deleted file mode 100644 index a064d8b..0000000 --- a/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# Android CI Gemfile - -source 'https://rubygems.org'; -gem 'thefuntasty_danger'; -gem 'danger-checkstyle_format'; -gem 'danger-android_lint'; -gem 'danger-junit' diff --git a/config/detekt.yml b/config/detekt.yml index fa27346..52e995b 100644 --- a/config/detekt.yml +++ b/config/detekt.yml @@ -1,5 +1,5 @@ build: - maxIssues: 50 + maxIssues: 5 excludeCorrectable: false config: diff --git a/plugin-build/gradle/libs.versions.toml b/plugin-build/gradle/libs.versions.toml deleted file mode 100644 index ef10e7e..0000000 --- a/plugin-build/gradle/libs.versions.toml +++ /dev/null @@ -1,14 +0,0 @@ -[versions] -kotlin = "1.9.20" -publish = "1.2.1" -kotlinx-serialization = "1.6.1" -sheetHappens = "0.5.6" - -[libraries] -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } - -[plugins] -kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -gradle-pluginPublish = { id = "com.gradle.plugin-publish", version.ref = "publish" } -sheetHappens = { id = "app.futured.sheethappens", version.ref = "sheetHappens" } \ No newline at end of file diff --git a/plugin-build/plugin/build.gradle.kts b/plugin-build/plugin/build.gradle.kts index 8c560aa..e191c6e 100644 --- a/plugin-build/plugin/build.gradle.kts +++ b/plugin-build/plugin/build.gradle.kts @@ -54,7 +54,7 @@ tasks.create("setupPublishSecrets") { detekt { ignoreFailures = false source.setFrom(files(projectDir)) - config.setFrom(files("$rootDir/config/detekt.yml")) + config.setFrom(files("$rootDir/../config/detekt.yml")) buildUponDefaultConfig = true } diff --git a/plugin-build/settings.gradle.kts b/plugin-build/settings.gradle.kts index de65bdd..a08482c 100644 --- a/plugin-build/settings.gradle.kts +++ b/plugin-build/settings.gradle.kts @@ -9,8 +9,14 @@ dependencyResolutionManagement { repositories { mavenCentral() } + + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } } rootProject.name = "app.futured.sheethappens" -include(":plugin") \ No newline at end of file +include(":plugin")