Getting started with GitHub Actions and Laravel (~PHP)

Ruben Van Assche from Spatie:

When GitHub released its new product: GitHub Actions a whole new world opened for developers. Let’s dive right in and see what it brings for the Laravel community.

In How to set up PHP for use in a GitHub Action I’ve layed out how to use shivammathur/[email protected] in GitHub Actions. This post goes very nicely along with it. Recommended read, even if you don’t write Laravel (like me).

I especially like the part where an extra MySQL service is spun up from within the workflow, and then used in the tests.

// ...

jobs:
    tests:
        // ...

        services:
            mysql:
                image: mysql:5.7
                env:
                    MYSQL_ALLOW_EMPTY_PASSWORD: yes
                    MYSQL_DATABASE: our-awesome-tested-app
                ports:
                    - 3306
                options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
                
        // ...

Getting started with GitHub Actions and Laravel →

Published by Bramus!

Bramus is a Freelance Web Developer from Belgium. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.