初期フローを作成した #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request Check | |
on: [pull_request] | |
env: | |
JAVA_VERSION: 17 | |
permissions: | |
pull-requests: write | |
jobs: | |
android-lint: | |
runs-on: ubuntu-latest | |
steps: | |
# setup | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Setup reviewdog | |
uses: reviewdog/action-setup@v1 | |
with: | |
reviewdog_version: latest | |
# android lintを実行 | |
- name: Android Lint | |
id: android-lint | |
run: ./gradlew lint | |
# report | |
- name: Comment PR by reviewdog | |
if: always() | |
run: | | |
find ./*/build/reports/android-lint/lintResults.sarif \ | |
-type f \ | |
-exec sh -c "cat {} | reviewdog -f=sarif -reporter=github-pr-review" \; | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ktlint: | |
runs-on: ubuntu-latest | |
steps: | |
# setup | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: ktlint | |
uses: ScaCap/action-ktlint@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
reporter: github-pr-review | |
fail_on_error: true | |
build_check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- run: ./gradlew assembleDebug | |
id: check_debug_build | |
- name: Comment report | |
if: failure() && steps.check_debug_build.outcome == 'failure' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
> [!CAUTION] | |
> デバッグビルドに失敗しました | |
comment_tag: debug_build_comment | |
- name: Comment report | |
if: success() && steps.check_debug_build.outcome == 'success' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
> [!TIP] | |
> デバッグビルドに成功しました | |
comment_tag: debug_build_comment | |
- run: ./gradlew assembleRelease | |
id: check_release_build | |
- name: Comment report | |
if: failure() && steps.check_release_build.outcome == 'failure' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
> [!CAUTION] | |
> リリースビルドに失敗しました | |
comment_tag: release_build_comment | |
- name: Comment report | |
if: success() && steps.check_release_build.outcome == 'success' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
> [!TIP] | |
> リリースビルドに成功しました | |
comment_tag: release_build_comment |