62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: Default
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
php: [ 7.1, 7.2, 7.3, 7.4, 8.0 ]
|
|
stability: [ prefer-lowest, prefer-stable ]
|
|
|
|
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: xdebug
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
run: composer validate
|
|
|
|
- name: Cache Composer packages
|
|
id: composer-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: vendor
|
|
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.php }}-
|
|
|
|
- name: Install dependencies
|
|
if: steps.composer-cache.outputs.cache-hit != 'true'
|
|
run: composer install --prefer-dist --no-progress --no-suggest
|
|
|
|
- name: Run test suite
|
|
run: ./vendor/bin/phpunit
|
|
|
|
semantic-release:
|
|
runs-on: ubuntu-latest
|
|
needs: [ test ]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12'
|
|
|
|
- name: Run semantic-release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
run: npx semantic-release |