Posts tagged with ci

Running PHP tests in parallel on GitHub actions

by Freek Van der Herten – 6 minute read

A couple of years ago, Laravel introduced a great feature which allows to run PHPUnit / Pest tests in parallel. This results in a big boost in performance.

By default, it determines the concurrency level by taking a look at the number of CPU cores your machine has. So, if you're using a modern Mac that has 10 CPU cores, it will run 10 tests at the same time, greatly cutting down on the time your testsuite needs to run completely.

A default runner on GitHub doesn't have that many cores, so you can't leverage parallel testing as good as in your typical local environments.

In this blog post, I'd like to show you a way of running your tests on GitHub, by splitting them up in small chunks that can run concurrently.

We use this technique at Oh Dear to cut down the running time of our vast testsuite from 16 minutes to only just 4. In this blog post all examples will come from the Oh Dear code base.

Read more

Join thousands of developers

Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

Moving PHP and Laravel tests from Travis CI to GitHub Actions

by Freek Van der Herten – 3 minute read

Earlier this year, Travis CI announced a new pricing model that effectively ends the generous open-source offering they had for many years. It seems that, even though there were some plans to provide free resources for OSS projects in the future, all activity for OSS projects has stopped.

At our company, we create a lot of open-source projects and packages. Beginning 2020, we already moved most of our stuff to GitHub actions.

Sure, you can read the GitHub actions docs to start learning the possibilities, but in my experience, it might be better to see some examples of practical uses cases. Here are some interesting links that might help you get started with GitHub actions.

Read more

Getting started with GitHub Actions and Laravel

rubenvanassche.com

My colleague Ruben explores the wonderful world of GitHub actions.

You can write workflows in YAML, which makes them easy to write and read. In the beta version of GitHub Actions you had to use Ocaml, which was quite hard to comprehend, and there was almost no documentation. If you were a bit frightened by the beta version, like me, then rest assured: the YAML version is easier to use, and the documentation is well written.

Read more [rubenvanassche.com]

Testing your Laravel app using GitHub actions

ma.ttias.be

Mattias Geniar explains how you can use GitHub actions to run the testsuite of your Laravel app.

Last year we wrote a blogpost about our setup we use for Oh Dear! with Gitlab, and how we use their pipelines for running our CI tests. Since then, we've moved back to Github since they introduced their free private repositories. In this post I'll describe how we re-configured our CI environment using Github Actions.

Read more [ma.ttias.be]