Save 37% off PRO during our Black Friday Sale! »

GitHub Actions でユニットテストの結果をレポートする

D8281434c0409ba2051cd3f7590e4c2f?s=47 Hiroyuki Kusu
November 17, 2021

GitHub Actions でユニットテストの結果をレポートする

potatotips #76 ( https://potatotips.connpass.com/event/224395/ ) の資料

D8281434c0409ba2051cd3f7590e4c2f?s=128

Hiroyuki Kusu

November 17, 2021
Tweet

Transcript

  1. GitHub Actions ͰϢχοτ ςετͷ݁ՌΛϨϙʔτ͢Δ 2021.11.17 potatotips #76 Hiroyuki Kusu (

    @hkusu_ )
  2. About me 

  3. ΈΜͳ͕஌ͬͯΔ͋ͷαʔϏεɺ ࣮͸ΏΊΈ͕࡞ͬͯ·͢ɻ શੈք5000ສMAUʹୡ͢ΔωοταʔϏεΛΦʔμʔϝΠυͰاըઃܭ͠ɺ γεςϜߏஙӡ༻͔ΒվળఏҊ·Ͱαϙʔτ͍͖ͯ͠·͢ɻ 

  4.  name: Pull Request Chec k on: pull_reques t jobs

    : check : name: Chec k runs-on: ubuntu-20.0 4 steps : - name: Check ou t uses: actions/checkout@v 2 - name: Set up JD K uses: actions/setup-java@v 2 with : distribution: 'zulu ' java-version: 1 1 cache: 'gradle ' - name: Run unit tes t run: ./gradlew testDebugUnitTest Github Actions ͰϢχοτςετΛ࣮ߦ
  5.  ϫʔΫϑϩʔͷϩάʹςετ݁Ռ͕දࣔ͞ΕΔ͕෼͔ΓͮΒ͍

  6.  JUnit Report Action ( GitHub Actions ) https://github.com/marketplace/actions/junit-report-action

  7.  name: Pull Request Chec k on: pull_reques t jobs

    : check : name: Chec k runs-on: ubuntu-20.0 4 steps : - name: Check ou t uses: actions/checkout@v 2 - name: Set up JD K uses: actions/setup-java@v 2 with : distribution: 'zulu ' java-version: 1 1 cache: 'gradle ' - name: Run unit tes t run: ./gradlew testDebugUnitTes t - name: Publish Test Repor t if: cancelled() != tru e uses: mikepenz/action-junit-report@v 2 with : report_paths: '**/build/test-results/*/TEST-*.xml' ௥Ճ
  8.  ςετ݁ՌͷαϚϦʔ fail ͨ͠ςετίʔυ΁ίϝϯτ ։ൃऀؒͰɺςετ݁Ռʹର͢Δٞ࿦ΛϓϧϦΫ্Ͱߦ͏͜ͱ͕ग़དྷΔ

  9.  • ϓϧϦΫͰมߋ͍ͯ͠ͳ͍ϑΝΠϧʹରͯ͠΋஫ऍΛ͍ΕΔ͜ͱ ͕Ͱ͖Δ • ࠓճ࠾༻ͨ͠ GitHub Actions ( JUnit

    Report Action) ͕͜ͷ ػೳΛར༻͍ͯ͠Δ • ৄ͘͠͸ GitHub ͷ Checks API Λࢀর • https://docs.github.com/en/rest/reference/checks#runs
  10. Thank you ! @hkusu_ ฐࣾ͸ Android ΤϯδχΞΛ ઈࢍืूத Ͱ͢ʂ