Upgrade to Pro — share decks privately, control downloads, hide ads and more …

#phperkaigi GitHub Actions使っていますか?では、cs2prも一緒にいかがですか?

#phperkaigi GitHub Actions使っていますか?では、cs2prも一緒にいかがですか?

hideki kinjyo

April 09, 2022
Tweet

More Decks by hideki kinjyo

Other Decks in Programming

Transcript

  1. ·ͱΊ • GitHub ActionsͰCIճ͍ͯ͠ΔͳΒɺcs2prΦεεϝͰ͢ʂ • cs2pr: CodeStyle (check) to Pull

    Request • Annotate a Pull Request based on a Checkstyle XML- report • GitHub ActionsͷఆٛΛ࣮࣭10ߦఔ౓͚ͩೖΕΔͱɺ PRͷʮίίʹ໰୊͕͋Δʯ͕ߦϨϕϧͰ෼͔ΔΑ͏ʹͳΔ
  2. cs2prͬͯͳΜͰ͔͢ʁ • GItHub Actions༻ͷπʔϧ • ֤ςετ(δϣϒ)ͷ࣮ߦ݁Ռ͔Βɺ PRͷΞϊςʔγϣϯΛೖΕͯ͘ΕΔػೳΛఏڙ͍ͯ͠Δ “Turns checkstyle based

    XML-Reports into GitHub Pull Request Annotations via the Checks API. This script is meant for use within your GitHub Action.”
  3. Checks API? • “Check Runs APIΛ࢖͏ͱɺϦϙδτϦͷίʔυมߋʹରͯ͠ڧྗͳ νΣοΫΛ࣮ߦ͢ΔGitHub AppΛߏஙͰ͖·͢ɻ ܧଓతΠϯςάϨʔ γϣϯɺίʔυͷߏจνΣοΫɺίʔυͷεΩϟϯαʔϏεΛ࣮ߦ͠ɺ

    ίϛοτʹ͍ͭͯৄࡉͳϑΟʔυόοΫΛߦ͏ΞϓϦΛ࡞੒Ͱ͖·͢ɻ” (via https://docs.github.com/ja/rest/guides/getting-started-with-the- checks-api) • “νΣοΫ࣮ߦʹ͸λΠϜελϯϓɺৄࡉ৘ใ͕هࡌ͞Εͨ֎෦αΠτ΁ ͷϦϯΫɺίʔυͷಛఆͷߦʹର͢ΔΞϊςʔγϣϯɺ͓Αͼ࣮ߦͨ͠ ෼ੳʹ͍ͭͯͷ৘ใΛؚΊΔ͜ͱ͕Ͱ͖·͢ɻ” (ಉ)
  4. Reviewdog • “reviewdog provides a way to post review comments

    to code hosting service, such as GitHub, automatically by integrating with any linter tools with ease.” (via https://github.com/reviewdog/reviewdog) • ActionsҎ֎ͷCIͰ΋࢖͑Δ • ChecksҎ֎ʹ΋ɺcomment/review commentʹ΋ରԠ͍ͯ͠Δ • ෯޿͍πʔϧʹରԠ͍ͯͯ͠ɺ೔ຊޠ৘ใ΋ଟ͍ • ݸਓతʹ͸ɺsetup-phpΛ࢖͑Δέʔεͩͱcs2prͷํ͕खܰͦ͏
  5. ࢀߟ৘ใ • PHPͰ࢝ΊΔGitHub Actions - Speaker Deck https://speakerdeck.com/yahiru/phpdeshi-merugithub-actions • =>

    cs2prͷݴٴ΋͋Γ·͢Α • GitHub Actions Toolkit: Problem Matchers https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md • => Problem Matcherͱ͸ʁ • setup-phpͱphpunit-problem-matcher ͷProblem Matcherʹ͍ͭͯ https://daisuki.nichiyoubi.land/entry/phperkaigi-2022-lt-hosoku • => ຊLTͷิ଍తͳهࣄ • πʔϧ໊ͷ༝དྷ(࡞ऀʹڭ͍͖͑ͯͨͩ·ͨ͠ʂ) https://twitter.com/markusstaab/status/1498552535900164105