diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 77fc949..f51a6e0 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,22 +13,27 @@ jobs: with: distribution: 'adopt' java-version: 11 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - - name: Bundle install + - uses: reviewdog/action-setup@v1 + with: + reviewdog_version: latest + - name: Set env run: | - bundle install + echo 'REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}' >> $GITHUB_ENV - name: Gradle clean run: | ./gradlew clean - name: Gradle build run: | ./gradlew build - - name: Run Danger - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + - name: Run reviewdog + if: always() run: | - bundle exec danger --verbose + find . -type f -name "ktlint*Check.xml" -exec sh -c "cat {} | reviewdog -f=checkstyle -name='ktlint' -reporter=github-pr-review" \; - name: Gradle publish to mavenLocal run: | ./gradlew publishToMavenLocal diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index ef538c2..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.1.2 diff --git a/Dangerfile b/Dangerfile deleted file mode 100644 index af24e3e..0000000 --- a/Dangerfile +++ /dev/null @@ -1,82 +0,0 @@ -# -# GitHub Comment -# -github.dismiss_out_of_range_messages({ - error: false, - warning: true, - message: true, - markdown: true -}) - -# -# File watching -# - -[ - ".idea/codeStyleSettings.xml", -].each do |file| - warn("Are you sure want to modify #{file} ?") if git.modified_files.include?(file) -end - -# -# Compiler warnings, errors -# - -warning_pattern = /w: (?(?:\/.+)+\.kt): \((?\d+), (?\d+)\): (?.*)/ -error_pattern = /e: (?(?:\/.+)+\.kt): \((?\d+), (?\d+)\): (?.*)/ - -target_files = (git.modified_files - git.deleted_files) + git.added_files -kotlin_compile_files = Dir.glob("**/build/kotlin/compile*Kotlin*.stdout") -unless kotlin_compile_files.empty? - compile_messages = File.read(kotlin_compile_files.first).strip - .split("\n") - .each { |s| - if match = s.match(warning_pattern) - file = Pathname(match[:path]).relative_path_from(Pathname(Dir.pwd)).to_s - if git.diff_for_file(file) - warn("#{match[:description]}", file: file, line: match[:line].to_i) - else - warn("#{file}: (#{match[:line]}, #{match[:column]}): #{match[:description]}") - end - end - if match = s.match(error_pattern) - file = Pathname(match[:path]).relative_path_from(Pathname(Dir.pwd)).to_s - if git.diff_for_file(file) - fail("#{match[:description]}", file: file, line: match[:line].to_i) - else - fail("#{file}: (#{match[:line]}, #{match[:column]}): #{match[:description]}") - end - end - } -end - -# -# ktlint -# -checkstyle_format.base_path = Dir.pwd -Dir.glob('**/build/reports/ktlint/ktlint*Check.xml') do |file| - checkstyle_format.report file -end - -# -# JUnit test results -# - -tests = [] -failures = [] -errors = [] -skipped = [] - -Dir.glob("**/build/test-results/**/TEST-*.xml") do |file| - junit.parse file - tests.concat(junit.tests) - failures.concat(junit.failures) - errors.concat(junit.errors) - skipped.concat(junit.skipped) -end -junit.tests = tests -junit.failures = failures -junit.errors = errors -junit.skipped = skipped - -junit.report diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 2b62d4d..0000000 --- a/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - -gem 'danger' -gem 'danger-junit' -gem 'danger-checkstyle_format' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index eeb4feb..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,90 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - claide (1.0.3) - claide-plugins (0.9.2) - cork - nap - open4 (~> 1.3) - colored2 (3.1.2) - cork (0.3.0) - colored2 (~> 3.1) - danger (8.3.1) - claide (~> 1.0) - claide-plugins (>= 0.9.2) - colored2 (~> 3.1) - cork (~> 0.1) - faraday (>= 0.9.0, < 2.0) - faraday-http-cache (~> 2.0) - git (~> 1.7) - kramdown (~> 2.3) - kramdown-parser-gfm (~> 1.0) - no_proxy_fix - octokit (~> 4.7) - terminal-table (>= 1, < 4) - danger-checkstyle_format (0.1.1) - danger-plugin-api (~> 1.0) - ox (~> 2.0) - danger-junit (1.0.2) - danger (> 2.0) - ox (~> 2.0) - danger-plugin-api (1.0.0) - danger (> 2.0) - faraday (1.8.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-http-cache (2.2.0) - faraday (>= 0.8) - faraday-httpclient (1.0.1) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - git (1.11.0) - rchardet (~> 1.8) - kramdown (2.3.1) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - multipart-post (2.1.1) - nap (1.1.0) - no_proxy_fix (0.1.2) - octokit (4.21.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - open4 (1.3.4) - ox (2.14.5) - public_suffix (4.0.6) - rchardet (1.8.0) - rexml (3.2.5) - ruby2_keywords (0.0.5) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.1.0) - -PLATFORMS - ruby - -DEPENDENCIES - danger - danger-checkstyle_format - danger-junit - -BUNDLED WITH - 2.2.3