Skip to content

Commit

Permalink
Add MacOS runner to CI/CD
Browse files Browse the repository at this point in the history
Convince the devs on Mac
  • Loading branch information
Vectorial1024 committed Dec 21, 2024
1 parent 69a4d9a commit 2f10736
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/macos_l11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PHP Composer (MacOS; Laravel 11)

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

# no macos runner has explicit PHP 8.2 support
# see https://github.com/marketplace/actions/setup-php-action
# specify PHP 8.2 to test Laravel 11
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

# dump autoload to "boot" our custom mock artisan
- name: Dump auto-load details
run: composer dump-autoload

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: composer run-script test
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ PHPUnit via Composer script:
composer run-script test
```

<!---
We also include MacOS on top of Ubuntu so that the devs (usually using Mac) can see for themselves it also works.
--->

Latest cross-platform testing results:
|Runtime|Ubuntu|Windows|
|---|---|---|
|Laravel 10 (PHP 8.1)|skipped*|skipped*|
|Laravel 11 (PHP 8.2)|[![Build-U-L11-PHP80200][build-u-l11-php80200-image]][build-u-l11-php80200-url]|[![Build-W-L11-PHP80200][build-w-l11-php80200-image]][build-w-l11-php80200-url]|
|Laravel 12 (PHP ???)|🛠️|🛠️|
|Runtime|MacOS|Ubuntu|Windows|
|---|---|---|---|
|Laravel 10 (PHP 8.1)|skipped*|skipped*|skipped*|
|Laravel 11 (PHP 8.2)|[![Build-M-L11-PHP80200][build-m-l11-php80200-image]][build-m-l11-php80200-url]|[![Build-U-L11-PHP80200][build-u-l11-php80200-image]][build-u-l11-php80200-url]|[![Build-W-L11-PHP80200][build-w-l11-php80200-image]][build-w-l11-php80200-url]|
|Laravel 12 (PHP ???)|🛠️|🛠️|🛠️|

\*Note: tests for these Laravel versions are skipped because they have old `artisan` file contents:
- It is difficult to mock multi-version `artisan` files for different Laravel versions (see https://github.com/Vectorial1024/laravel-process-async/issues/6).
Expand All @@ -77,6 +81,9 @@ Latest cross-platform testing results:
[packagist-stats-url]: https://packagist.org/packages/vectorial1024/laravel-process-async/stats
[github-repo-url]: https://github.com/Vectorial1024/laravel-process-async

[build-m-l11-php80200-url]: https://github.com/Vectorial1024/laravel-process-async/actions/workflows/macos_l11.yml
[build-m-l11-php80200-image]: https://img.shields.io/github/actions/workflow/status/Vectorial1024/laravel-process-async/macos_l11.yml?style=plastic

[build-u-l11-php80200-url]: https://github.com/Vectorial1024/laravel-process-async/actions/workflows/ubuntu_l11.yml
[build-u-l11-php80200-image]: https://img.shields.io/github/actions/workflow/status/Vectorial1024/laravel-process-async/ubuntu_l11.yml?style=plastic

Expand Down

0 comments on commit 2f10736

Please sign in to comment.