Skip to content

Commit 2f10736

Browse files
committed
Add MacOS runner to CI/CD
Convince the devs on Mac
1 parent 69a4d9a commit 2f10736

File tree

2 files changed

+63
-5
lines changed

2 files changed

+63
-5
lines changed

.github/workflows/macos_l11.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PHP Composer (MacOS; Laravel 11)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
# no macos runner has explicit PHP 8.2 support
16+
# see https://github.com/marketplace/actions/setup-php-action
17+
# specify PHP 8.2 to test Laravel 11
18+
runs-on: macos-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup PHP with PECL extension
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '8.2'
27+
28+
- name: Validate composer.json and composer.lock
29+
run: composer validate --strict
30+
31+
- name: Cache Composer packages
32+
id: composer-cache
33+
uses: actions/cache@v3
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-php-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist --no-progress
42+
43+
# dump autoload to "boot" our custom mock artisan
44+
- name: Dump auto-load details
45+
run: composer dump-autoload
46+
47+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
48+
# Docs: https://getcomposer.org/doc/articles/scripts.md
49+
50+
- name: Run test suite
51+
run: composer run-script test

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@ PHPUnit via Composer script:
6161
composer run-script test
6262
```
6363

64+
<!---
65+
We also include MacOS on top of Ubuntu so that the devs (usually using Mac) can see for themselves it also works.
66+
--->
67+
6468
Latest cross-platform testing results:
65-
|Runtime|Ubuntu|Windows|
66-
|---|---|---|
67-
|Laravel 10 (PHP 8.1)|skipped*|skipped*|
68-
|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]|
69-
|Laravel 12 (PHP ???)|🛠️|🛠️|
69+
|Runtime|MacOS|Ubuntu|Windows|
70+
|---|---|---|---|
71+
|Laravel 10 (PHP 8.1)|skipped*|skipped*|skipped*|
72+
|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]|
73+
|Laravel 12 (PHP ???)|🛠️|🛠️|🛠️|
7074

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

84+
[build-m-l11-php80200-url]: https://github.com/Vectorial1024/laravel-process-async/actions/workflows/macos_l11.yml
85+
[build-m-l11-php80200-image]: https://img.shields.io/github/actions/workflow/status/Vectorial1024/laravel-process-async/macos_l11.yml?style=plastic
86+
8087
[build-u-l11-php80200-url]: https://github.com/Vectorial1024/laravel-process-async/actions/workflows/ubuntu_l11.yml
8188
[build-u-l11-php80200-image]: https://img.shields.io/github/actions/workflow/status/Vectorial1024/laravel-process-async/ubuntu_l11.yml?style=plastic
8289

0 commit comments

Comments
 (0)