$30 off During Our Annual Pro Sale. View Details »

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

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

Kishikawa Katsumi

October 18, 2021
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

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

    View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. Xcode result bundle

    View Slide

  8. Xcode result bundle

    View Slide

  9. $ xcresulttool

    View Slide

  10. $ xcrun xcresulttool get --path results.xcresult --format json


    {


    "_type" : {


    "_name" : "ActionsInvocationRecord"


    },


    "actions" : {


    "_type" : {


    "_name" : "Array"


    },


    "_values" : [


    {


    "_type" : {


    "_name" : "ActionRecord"


    },


    "actionResult" : {


    "_type" : {


    "_name" : "ActionResult"


    },


    "coverage" : {


    "_type" : {


    "_name" : "CodeCoverageInfo"


    }


    },


    "diagnosticsRef" : {


    "_type" : {


    "_name" : "Reference"


    },


    "id" : {


    "_type" : {


    "_name" : "String"


    },


    "_value" : "0~vHg7If_A0mZHPjzIsvdzoL3IMfYHwL0Z3rj6u9zpzhXhMGPmKNKQ6J5lQj8MHSuoz26pval1lC8J4W8bxYO52A=="


    }

    View Slide

  11. $ xcrun xcresulttool get --path results.xcresult --format json


    {


    "_type" : {


    "_name" : "ActionsInvocationRecord"


    },


    "actions" : {


    "_type" : {


    "_name" : "Array"


    },


    "_values" : [


    {


    "_type" : {


    "_name" : "ActionRecord"


    },


    "actionResult" : {


    "_type" : {


    "_name" : "ActionResult"


    },


    "coverage" : {


    "_type" : {


    "_name" : "CodeCoverageInfo"


    }


    },


    "diagnosticsRef" : {


    "_type" : {


    "_name" : "Reference"


    },


    "id" : {


    "_type" : {


    "_name" : "String"


    },


    "_value" : "0~vHg7If_A0mZHPjzIsvdzoL3IMfYHwL0Z3rj6u9zpzhXhMGPmKNKQ6J5lQj8MHSuoz26pval1lC8J4W8bxYO52A=="


    }

    View Slide

  12. $ xcrun xcresulttool get --path results.xcresult --format json \


    --id "0~0I_MUIRIScR7EhYb3xNOgrrrCppe_B9k1ewbNE0HZs4qyaVJRD1xjS3UbUY272hciPa1kSxSDXXsRUODkYY2Uw=="


    {


    "_type" : {


    "_name" : "ActionsInvocationMetadata"


    },


    "creatingWorkspaceFilePath" : {


    "_type" : {


    "_name" : "String"


    },


    "_value" : "\/Users\/katsumi\/Develop\/Weather\/Weather.xcodeproj"


    },


    View Slide

  13. $ xcrun xcresulttool get --path results.xcresult --format json \


    --id "0~0I_MUIRIScR7EhYb3xNOgrrrCppe_B9k1ewbNE0HZs4qyaVJRD1xjS3UbUY272hciPa1kSxSDXXsRUODkYY2Uw=="


    {


    "_type" : {


    "_name" : "ActionsInvocationMetadata"


    },


    "creatingWorkspaceFilePath" : {


    "_type" : {


    "_name" : "String"


    },


    "_value" : "\/Users\/katsumi\/Develop\/Weather\/Weather.xcodeproj"


    },


    View Slide

  14. GitHub Checks API

    View Slide

  15. View Slide

  16. Conclusion
    Summary
    Annotations

    View Slide

  17. View Slide

  18. ط஌ͷ໰୊ɾ੍ݶࣄ߲
    • Annotation͸̍εςοϓʹ͖ͭ10ݸ·ͰɺશମͰ50ݸ·Ͱ

    • UIςετதʹࡱͬͨεΫϦʔϯγϣοτΛΘ͔Γ΍͘͢ද͍ࣔͨ͠

    • Artifactsʹอଘ͢Δ

    • Action಺͔Β௚઀ͷURLΛࢀর͢Δखஈ͕ͳ͍

    • ը૾ͱͯ͠ࢀর͢Δखஈ͕ͳ͍ʢZipʹͳΔʣ

    • Releaseʹอଘ͢Δ

    • Releaseʹ͸λά͕ඞཁʢPR͝ͱʹ࡞Δʁʣ

    • ઐ༻ͷεΫϦʔϯγϣοτஔ͖৔ͷϦϙδτϦΛ࡞Δʁ

    • ϦϙδτϦʹίϛοτ͢Δ

    • ϦϙδτϦʹෆཁͳίϛοτ͕૿͑ΔʢϒϥϯνͰִ཭͢Ε͹͍͍͔΋ʣ

    • ઐ༻ͷϦϙδτϦΛ࡞Δʁ

    View Slide

  19. View Slide

  20. References
    • ϝϧϖΠͰͷxcresult׆༻ࣄྫ | ϝϧΧϦΤϯδχΞϦϯά

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

    • Xcode 11ͰͷςετपΓͷ৽ػೳΛ঺հ͠·͢ʂ - DeNA Testing Blog

    https://swet.dena.com/entry/2019/10/23/080000

    • xcparse | ChargePoint

    https://www.chargepoint.com/engineering/xcparse/

    • xcresulttool GitHub Actions

    https://github.com/kishikawakatsumi/xcresulttool

    View Slide