Skip to content

[#493] Integrate Danger to the generated project #1588

[#493] Integrate Danger to the generated project

[#493] Integrate Danger to the generated project #1588

name: Review pull request
on:
pull_request:
types: [ opened, edited, reopened, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
review_pull_request:
name: Review pull request
runs-on: ubuntu-latest
timeout-minutes: 30
environment: template-compose
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout source code
uses: actions/checkout@v4
- name: Cache Gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# template-compose
- name: Run Detekt on template-compose
working-directory: ./template-compose
run: ./gradlew detekt
- name: Run Android Lint on template-compose
working-directory: ./template-compose
run: ./gradlew lint
- name: Run unit tests with Kover on template-compose
working-directory: ./template-compose
run: ./gradlew koverXmlReport
danger:
needs: review_pull_request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
run: bundle install
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: MeilCli/danger-action@v6
with:
plugins_file: 'Gemfile'
install_path: 'vendor/bundle'
danger_file: 'Dangerfile'
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}