Skip to content

Commit f0d2c16

Browse files
committed
Add CI/CD workflows
1 parent 041a864 commit f0d2c16

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

.github/workflows/ubuntu_l10.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PHP Composer (Ubuntu; Laravel 10)
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+
# ubuntu-latest has PHP 8.1
16+
# see https://github.com/marketplace/actions/setup-php-action
17+
# specify PHP 8.1 to test Laravel 10
18+
runs-on: ubuntu-20.04
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.1'
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

.github/workflows/ubuntu_l11.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PHP Composer (Ubuntu; 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+
# ubuntu-latest has PHP 8.1
16+
# see https://github.com/marketplace/actions/setup-php-action
17+
# specify PHP 8.2 to test Laravel 11
18+
runs-on: ubuntu-20.04
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

0 commit comments

Comments
 (0)