Skip to content

build

build #499

Workflow file for this run

name: build
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**.php'
- .github/workflows/build.yml
- composer.json
pull_request:
paths:
- '**.php'
- .github/workflows/build.yml
- composer.json
jobs:
main:
name: Build [PHP ${{ matrix.php-versions }}]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions}}
extensions: xdebug
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
- name: Create cache directory
run: mkdir --parents build
- name: Cache PHPStan cache directory
uses: actions/cache@v3
with:
path: build/phpstan
key: phpstan-${{ runner.os }}-${{ github.sha }}
restore-keys: |
phpstan-${{ runner.os }}-
phpstan-
- name: Setup Composer's GitHub OAuth access
run: composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: composer update --ansi
- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run --using-cache=no --diff
- name: Run PHPStan Static Analysis Check
run: vendor/bin/phpstan analyse --ansi
- name: Run Nexus Tachycardia Test Suite
run: vendor/bin/phpunit --color=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-version }}
coveralls-finish:
name: Coveralls Finished
needs: [main]
runs-on: ubuntu-20.04
steps:
- name: Upload to Coveralls API
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true