Update androidx.test #347
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: check pr | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
- 'develop' | |
- 'feature/**' | |
- 'release/**' | |
jobs: | |
spotless: | |
name: runner / suggester / spotless | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
cache: "gradle" | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Run Spotless | |
run: ./gradlew --no-daemon spotlessKotlinApply | |
- uses: reviewdog/action-suggester@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tool_name: spotless | |
android_lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 # デフォルトは360分 | |
strategy: | |
matrix: | |
ruby: [ '2.7' ] | |
steps: | |
# 連続でpushした際などは、前回のジョブが残っていたら停止させる | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
cache: "gradle" | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Cache Gradle | |
uses: actions/cache@v2 | |
id: cache_gradle | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- uses: actions/cache@v1 | |
name: Cache Bundler | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('.github/danger/android_lint.Gemfile') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.ruby }}-gems- | |
- name: run android lint | |
run: ./gradlew --no-daemon :app:lintDebug | |
- uses: MeilCli/danger-action@v5 | |
if: always() | |
name: Run Danger | |
with: | |
plugins_file: '.github/danger/android_lint.Gemfile' | |
install_path: 'vendor/bundle' | |
danger_file: '.github/danger/android_lint.Dangerfile' | |
danger_id: 'danger-android-lint' | |
env: | |
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: notify result | |
if: always() | |
uses: ./.github/workflows/composite/notify-result-action | |
with: | |
job-title: 'Android Lint' | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
unit_test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
cache: "gradle" | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Run unit test | |
run: | | |
./gradlew --no-daemon app:testDebugUnitTest | |
- name: Publish Test Report | |
if: cancelled() != true | |
uses: mikepenz/action-junit-report@v2 | |
with: | |
report_paths: '**/build/test-results/*/TEST-*.xml' | |
- name: notify result | |
if: always() | |
uses: ./.github/workflows/composite/notify-result-action | |
with: | |
job-title: 'Unit Test' | |
github-token: ${{secrets.GITHUB_TOKEN}} |