{"id":3686,"date":"2023-01-10T13:32:13","date_gmt":"2023-01-10T12:32:13","guid":{"rendered":"https:\/\/vielhuber.de\/?p=3686"},"modified":"2023-01-10T13:48:54","modified_gmt":"2023-01-10T12:48:54","slug":"ci-mit-github-actions","status":"publish","type":"post","link":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/","title":{"rendered":"CI mit GitHub Actions"},"content":{"rendered":"\n<p>Als Alternative zum hoch gesch\u00e4tzten <a href=\"https:\/\/www.travis-ci.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Travis CI<\/a> bietet sich seit geraumer Zeit auch <a href=\"https:\/\/github.com\/features\/actions\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub Actions<\/a> an, das als Continuous Integration Tool sehr gut auf der Code-Plattform GitHub integriert ist und inzwischen sehr stabil l\u00e4uft. GitHub Actions basieren auf YAML-Konfigurationsdateien, die in dem Repository abgelegt werden, in dem der Workflow ausgef\u00fchrt werden soll.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Nachfolgend befindet sich eine Boilerplate-YAML-Datei, die gen\u00fcgt, um beim n\u00e4chsten Push automatisierte Tests z.B. auf Basis von <a href=\"https:\/\/phpunit.com\" target=\"_blank\" rel=\"noreferrer noopener\">PHPUnit<\/a> und <a href=\"https:\/\/jestjs.io\" target=\"_blank\" rel=\"noreferrer noopener\">Jest<\/a> in verschiedenen Umgebungen auszuf\u00fchren \u2013 auch eine Integration von <a href=\"https:\/\/www.mysql.com\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL<\/a> oder <a href=\"https:\/\/www.postgresql.org\" target=\"_blank\" rel=\"noreferrer noopener\">PostgreSQL<\/a> (oder einer der Vielzahl an anderen Actions im <a href=\"https:\/\/github.com\/marketplace?type=actions\" target=\"_blank\" rel=\"noreferrer noopener\">Marketplace<\/a>) ist kein Problem:<\/p>\n\n\n\n<p class=\"githubgist\" data-gist-file=\"ci.yml\">4130f4fc3ee978baafb1b24b7e623190<\/p>\n\n\n\n<p>Anschlie\u00dfend findet man im Repository im Reiter \"Actions\" alle laufenden Tests. Das Tolle: GitHub Actions ist f\u00fcr \u00f6ffentliche Repositories (f\u00fcr 2.000 Minuten pro Monat) v\u00f6llig kostenlos nutzbar. Will man vorab lokal experimentieren, empfiehlt sich z.B. das Tool <a href=\"https:\/\/github.com\/nektos\/act\" target=\"_blank\" rel=\"noreferrer noopener\">act<\/a>, mit dem man die Runner auch lokal simulieren kann.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut auf der Code-Plattform GitHub integriert ist und inzwischen sehr stabil l\u00e4uft. GitHub Actions basieren auf YAML-Konfigurationsdateien, die in dem Repository abgelegt werden, in dem der Workflow ausgef\u00fchrt werden soll.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"gtbabel_prevent_lngs":"","gtbabel_alt_lng":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-3686","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-blog"},"acf":[],"yoast_head":"<title>CI mit GitHub Actions &#060; Vielhuber David<\/title>\n<meta name=\"description\" content=\"Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut au...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CI mit GitHub Actions &#060; Vielhuber David\" \/>\n<meta property=\"og:description\" content=\"Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut auf der\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/\" \/>\n<meta property=\"og:site_name\" content=\"Vielhuber David\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-10T12:32:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-10T12:48:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"552\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"David\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vielhuber\" \/>\n<meta name=\"twitter:site\" content=\"@vielhuber\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"David\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/\"},\"author\":{\"name\":\"David\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"headline\":\"CI mit GitHub Actions\",\"datePublished\":\"2023-01-10T12:32:13+00:00\",\"dateModified\":\"2023-01-10T12:48:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/\"},\"wordCount\":164,\"publisher\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"articleSection\":[\"Blog\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/\",\"name\":\"CI mit GitHub Actions &#060; Vielhuber David\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#website\"},\"datePublished\":\"2023-01-10T12:32:13+00:00\",\"dateModified\":\"2023-01-10T12:48:54+00:00\",\"description\":\"Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut auf der\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/ci-mit-github-actions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vielhuber.de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CI mit GitHub Actions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#website\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/\",\"name\":\"Vielhuber David\",\"description\":\"Full-Stack Developer\",\"publisher\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vielhuber.de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\",\"name\":\"David\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"contentUrl\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"width\":700,\"height\":552,\"caption\":\"David\"},\"logo\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/vielhuber\"]}]}<\/script>","yoast_head_json":{"title":"CI mit GitHub Actions &#060; Vielhuber David","description":"Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut au...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/","og_locale":"de_DE","og_type":"article","og_title":"CI mit GitHub Actions &#060; Vielhuber David","og_description":"Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut auf der","og_url":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/","og_site_name":"Vielhuber David","article_published_time":"2023-01-10T12:32:13+00:00","article_modified_time":"2023-01-10T12:48:54+00:00","og_image":[{"width":700,"height":552,"url":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","type":"image\/jpeg"}],"author":"David","twitter_card":"summary_large_image","twitter_creator":"@vielhuber","twitter_site":"@vielhuber","twitter_misc":{"Verfasst von":"David","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/#article","isPartOf":{"@id":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/"},"author":{"name":"David","@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"headline":"CI mit GitHub Actions","datePublished":"2023-01-10T12:32:13+00:00","dateModified":"2023-01-10T12:48:54+00:00","mainEntityOfPage":{"@id":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/"},"wordCount":164,"publisher":{"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"articleSection":["Blog"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/","url":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/","name":"CI mit GitHub Actions &#060; Vielhuber David","isPartOf":{"@id":"https:\/\/vielhuber.de\/#website"},"datePublished":"2023-01-10T12:32:13+00:00","dateModified":"2023-01-10T12:48:54+00:00","description":"Als Alternative zum hoch gesch\u00e4tzten Travis CI bietet sich seit geraumer Zeit auch GitHub Actions an, das als Continuous Integration Tool sehr gut auf der","breadcrumb":{"@id":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vielhuber.de\/blog\/ci-mit-github-actions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vielhuber.de\/"},{"@type":"ListItem","position":2,"name":"CI mit GitHub Actions"}]},{"@type":"WebSite","@id":"https:\/\/vielhuber.de\/#website","url":"https:\/\/vielhuber.de\/","name":"Vielhuber David","description":"Full-Stack Developer","publisher":{"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vielhuber.de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":["Person","Organization"],"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef","name":"David","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","url":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","contentUrl":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","width":700,"height":552,"caption":"David"},"logo":{"@id":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg"},"sameAs":["https:\/\/x.com\/vielhuber"]}]}},"_links":{"self":[{"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/posts\/3686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/comments?post=3686"}],"version-history":[{"count":6,"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/posts\/3686\/revisions"}],"predecessor-version":[{"id":3694,"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/posts\/3686\/revisions\/3694"}],"wp:attachment":[{"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/media?parent=3686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/categories?post=3686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vielhuber.de\/so\/wp-json\/wp\/v2\/tags?post=3686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}