Skip to content

Tests and linting #1924

Tests and linting

Tests and linting #1924

Workflow file for this run

name: Tests and linting
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
dependencies: ['']
name: PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
XDEBUG_MODE: coverage
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, zip
coverage: xdebug
ini-values: ${{ matrix.xdebug-ini-values }}
- name: Install dependencies
run: composer update --no-interaction ${{ matrix.dependencies }}
- name: Dump current environment variables
run: env
- name: Dump current build properties
run: php dump-current.php
- name: Run tests
run: |
(unset GITHUB_ACTIONS
vendor/bin/phpunit --colors=always --coverage-clover build/logs/clover.xml)
- name: Submit coverage to Coveralls
if: github.event_name != 'pull_request'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NO_COLOR: 'true'
run: |
composer global require php-coveralls/php-coveralls
~/.composer/vendor/bin/php-coveralls --coverage_clover=./build/logs/clover.xml -v
codestyle:
name: "Code style and static analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl
- name: Install dependencies
run: composer update --no-interaction
- name: Lint
run: composer lint
- name: Run checks
run: composer analyze
markdown-link-check:
name: "Markdown link check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
config-file: '.github/mlc_config.json'