2019-10-03 07:08:21 +02:00
|
|
|
name: PHP Composer
|
2019-09-01 13:33:11 +02:00
|
|
|
|
2020-02-12 13:26:01 -05:00
|
|
|
on:
|
|
|
|
|
push:
|
2020-07-13 12:12:41 -07:00
|
|
|
branches: [ $default-branch ]
|
2020-02-12 13:26:01 -05:00
|
|
|
pull_request:
|
2020-07-13 12:12:41 -07:00
|
|
|
branches: [ $default-branch ]
|
2019-09-01 13:33:11 +02:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
steps:
|
2019-12-24 14:22:22 -08:00
|
|
|
- uses: actions/checkout@v2
|
2019-09-01 13:33:11 +02:00
|
|
|
|
|
|
|
|
- name: Validate composer.json and composer.lock
|
2021-02-26 23:31:13 +01:00
|
|
|
run: composer validate --strict
|
2020-07-13 12:12:41 -07:00
|
|
|
|
2019-11-14 15:24:32 +01:00
|
|
|
- name: Cache Composer packages
|
|
|
|
|
id: composer-cache
|
2020-05-27 10:49:51 -04:00
|
|
|
uses: actions/cache@v2
|
2019-11-14 15:24:32 +01:00
|
|
|
with:
|
|
|
|
|
path: vendor
|
2020-06-16 18:44:47 -04:00
|
|
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
2019-11-14 15:24:32 +01:00
|
|
|
restore-keys: |
|
2020-06-16 18:44:47 -04:00
|
|
|
${{ runner.os }}-php-
|
2019-09-01 13:33:11 +02:00
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2021-03-18 15:28:14 +02:00
|
|
|
run: composer install --prefer-dist --no-progress
|
2019-09-01 13:33:11 +02:00
|
|
|
|
2019-10-03 07:08:21 +02:00
|
|
|
# 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
|