Skip to content

Fixed PHP 8.2 issue in templating #37

Fixed PHP 8.2 issue in templating

Fixed PHP 8.2 issue in templating #37

Workflow file for this run

# GitHub Actions Documentation: https://docs.github.com/en/actions
name: build
on: [push, pull_request]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
jobs:
build:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.2', '7.3', '7.4', '8.0']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Set git to use LF on Windows
if: matrix.operating-system == 'windows-latest'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, dom, simplexml, xmlwriter, ctype, iconv, curl
coverage: xdebug
tools: composer
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
shell: bash
run: composer install --no-progress --optimize-autoloader
- name: Setup Code Climate test-reporter
if: matrix.operating-system == 'ubuntu-latest' && matrix.php-versions == 8.0
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Check coding standards (PHP_CodeSniffer)
if: matrix.operating-system != 'macos-latest'
run: vendor/bin/phpcs
- name: Run unit tests (PHPUnit)
run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
- name: Publish coverage report to Codecov
if: matrix.operating-system == 'ubuntu-latest'
run: |
bash <(curl -s https://codecov.io/bash) -f clover.xml
if [ ${{ matrix.php-versions }} == 8.0 ]; then ./cc-test-reporter after-build --coverage-input-type clover; fi;
- name: "Statically analyze code (PHPStan)"
run: vendor/bin/phpstan analyse
- name: Statically analyze code (Psalm)
run: vendor/bin/psalm --output-format=github --taint-analysis --shepherd --report=build/logs/psalm.sarif
- name: "Upload security analysis results to GitHub"
uses: "github/codeql-action/upload-sarif@v1"
with:
sarif_file: "build/logs/psalm.sarif"