Skip to content

Commit

Permalink
Add CI/CD workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorial1024 committed Nov 27, 2024
1 parent 041a864 commit f0d2c16
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ubuntu_l10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PHP Composer (Ubuntu; Laravel 10)

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

permissions:
contents: read

jobs:
build:

# ubuntu-latest has PHP 8.1
# see https://github.com/marketplace/actions/setup-php-action
# specify PHP 8.1 to test Laravel 10
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

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

- 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
51 changes: 51 additions & 0 deletions .github/workflows/ubuntu_l11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PHP Composer (Ubuntu; Laravel 11)

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

permissions:
contents: read

jobs:
build:

# ubuntu-latest has PHP 8.1
# see https://github.com/marketplace/actions/setup-php-action
# specify PHP 8.2 to test Laravel 11
runs-on: ubuntu-20.04

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

0 comments on commit f0d2c16

Please sign in to comment.