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

GitHub Actionsでテストの結果をわかりやすく表示する

GitHub Actionsでテストの結果をわかりやすく表示する

Xcode Result Bundle
データ構造
xcresulttool
GitHub Checks
GitHub Actions
API
画像の表示
Undocumentedな制限事項
GitHub Flavored Markdown
キレイに表示するコツ

Kishikawa Katsumi

October 27, 2021
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

  1. GitHub ActionsͰςετͷ݁ՌΛ
    Θ͔Γ΍͘͢දࣔ͢Δ

    View Slide

  2. GitHub ActionsͰςετͷ݁ՌΛΘ͔Γ΍͘͢දࣔ͢Δ
    • Xcode Result Bundle
    • σʔλߏ଄

    • xcresulttool

    • GitHub Checks
    • GitHub Actions

    • API

    • ը૾ͷදࣔ

    • Undocumentedͳ੍ݶࣄ߲

    • GitHub Flavored Markdown
    • ΩϨΠʹදࣔ͢Δίπ

    View Slide

  3. View Slide

  4. https://github.com/kishikawakatsumi/xcresulttool-example/pull/2/checks?check_run_id=3954797886

    View Slide

  5. https://github.com/kishikawakatsumi/xcresulttool-example/pull/2/checks?check_run_id=3954797886

    View Slide

  6. https://github.com/kishikawakatsumi/xcresulttool-example/pull/2/checks?check_run_id=3954797886

    View Slide

  7. View Slide

  8. Xcode result bundle

    View Slide

  9. Xcode result bundle

    View Slide

  10. $ xcresulttool

    View Slide

  11. View Slide

  12. xcresulttool
    xcresulttool get --path Example.xcresult [--format json | raw] [--id ID]
    xcresulttool export --type [file | directory] --path Example.xcresult --output-path ./Out --id ID
    xcresulttool formatDescription [get] [--format json | text | markdown | typeHierarchy] [--hash]

    View Slide

  13. xcresulttool
    xcresulttool get --path Example.xcresult [--format json | raw] [--id ID]
    xcresulttool export --type [file | directory] --path Example.xcresult --output-path ./Out --id ID
    xcresulttool formatDescription [get] [--format json | text | markdown | typeHierarchy] [--hash]

    View Slide

  14. xcresulttool
    xcrun xcresulttool get --path __tests__/data/Example.xcresult --format json

    View Slide

  15. View Slide

  16. View Slide

  17. xcresulttool
    xcrun xcresulttool get --path __tests__/data/Example.xcresult --format json \


    --id “0~2h6n8a1U7EWQlPI84iSvAot2tGmEw4...QYjQ=="

    View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. xcresulttool
    xcresulttool get --path Example.xcresult [--format json | raw] [--id ID]
    xcresulttool export --type [file | directory] --path Example.xcresult --output-path ./Out --id ID
    xcresulttool formatDescription [get] [--format json | text | markdown | typeHierarchy] [--hash]

    View Slide

  23. xcresulttool
    xcrun xcresulttool export --path __tests__/data/Example.xcresult \


    —id "0~bxJjbddFGu_5klZSLsMwAPnWdsfg1lVn1...W7A==" \


    --type file --output-path ./screenshot.png

    View Slide

  24. xcresulttool
    xcresulttool get --path Example.xcresult [--format json | raw] [--id ID]
    xcresulttool export --type [file | directory] --path Example.xcresult --output-path ./Out --id ID
    xcresulttool formatDescription [get] [--format json | text | markdown | typeHierarchy] [--hash]

    View Slide

  25. View Slide

  26. GitHub Checks

    View Slide

  27. Conclusion
    Summary
    Annotations

    View Slide

  28. GitHub Checks
    • GitHub Actions΍֎෦ͷCIαʔϏε͔Βͷ݁ՌΛϑΟʔυόοΫͰ͖Δ

    • Pull Requestͷը໘ʹλϒ͕͋ΔͷͰΞΫηε͠΍͍͢

    • εςʔλεʢ੒ޭɾࣦഊʣ͚ͩͰͳ͘ɺϩά΍ը૾ɺΞϊςʔγϣϯͳͲϦο
    νͳ৘ใΛදࣔͰ͖Δ

    • ChecksΛߋ৽Ͱ͖Δͷ͸GitHub AppsʹݶΔ͕ɺGitHub Actions͸Appѻ͍ʹ
    ͳ͍ͬͯΔͷͰߋ৽Ͱ͖Δ

    View Slide

  29. View Slide

  30. ը૾ͷදࣔ

    View Slide

  31. ը૾ͷදࣔ

    View Slide

  32. ը૾ͷදࣔ

    View Slide

  33. ੍ݶࣄ߲
    • APIͷ֤߲໨ʹ౉ͤΔจࣈ਺͸࠷େ65535จࣈ

    • Ξϊςʔγϣϯ͸50ݸ·Ͱ

    View Slide

  34. GitHub Flavored MarkdownͰ


    ΩϨΠʹϨΠΞ΢τ͢Δ

    View Slide

  35. View Slide

  36. View Slide

  37. View Slide

  38. ςʔϒϧͰϨΠΞ΢τ͢Δ

    View Slide

  39. View Slide

  40. View Slide

  41. ·ͱΊ
    • GitHub Checks͸PRͷը໘͔ΒΞΫηε͠΍͍͢

    • CIͷ݁ՌͰඞཁͳ΋ͷΛ͍Ζ͍Ζදࣔ͢Δͱศར

    • MarkdownʢʴHTMLʣ͕࢖͑ΔͷͰϦονͳදࣔ΋Մೳ

    View Slide

  42. References
    • https://github.com/kishikawakatsumi/xcresulttool

    • https://github.com/kishikawakatsumi/bitrise-step-xcode-result-bundle-to-checks

    • https://github.com/ChargePoint/xcparse

    • https://engineering.mercari.com/blog/entry/20201218-61f7110851/

    View Slide