Skip to content

build

build #270

Workflow file for this run

name: build
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- develop
- feature/**
- bugfix/**
- release/**
paths:
- src/**
- tests/**
- .github/workflows/build.yml
- composer.json
- phpunit.xml.dist
pull_request:
branches:
- develop
paths:
- src/**
- tests/**
- .github/workflows/build.yml
- composer.json
- phpunit.xml.dist
jobs:
main:
name: Build [PHP ${{ matrix.php-versions }}]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4', '8.0']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer
extensions: curl, intl, mbstring, xdebug
coverage: xdebug
- name: Validate composer.json
run: composer validate --strict
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Create composer cache directory
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Create PHPStan cache directory
run: mkdir -p build/phpstan
- name: Cache PHPStan cache directory
uses: actions/cache@v2
with:
path: build/phpstan
key: ${{ runner.os }}-phpstan-${{ github.sha }}
restore-keys: ${{ runner.os }}-phpstan-
- name: Setup Composer's GitHub OAuth access
run: composer config --global github-oauth.github.com ${{ secrets.ACCESS_TOKEN }}
- name: Install dependencies
run: composer update --ansi --no-scripts --no-interaction
- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run --using-cache=no
- name: Run PHPStan Static Analysis Check
run: vendor/bin/phpstan analyse --ansi
- name: Run Liaison Revision Test Suite
run: vendor/bin/phpunit --colors=always
env:
TACHYCARDIA_MONITOR_GA: enabled
- name: Run Coveralls
run: |
composer global require --ansi php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }}
coveralls-finish:
name: Coveralls Finished
needs: [main]
runs-on: ubuntu-latest
steps:
- name: Upload to Coveralls API
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true