Skip to content

Codacy link update

Codacy link update #24

Workflow file for this run

name: Run tests
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '7.4'
has_unique_dependencies: true
has_unique_phpspec_tests: true
- php: '8.0'
has_unique_dependencies: true
- php: '8.1'
has_unique_dependencies: true
- php: '8.2'
upload_coverage: true
#TODO test against PHP 8.3 when PHPSpec supports it
#- php: '8.3'
container: ghcr.io/articus/phpdbg-coveralls:${{ matrix.php }}_2.6.0_2023-12-18
steps:
- name: Workaround for https://git-scm.com/docs/git-config/2.39.2#Documentation/git-config.txt-safedirectory
run: chown root:root ./
- name: Checkout code
uses: actions/checkout@v4
- name: Use unique composer.lock
if: matrix.has_unique_dependencies
run: cp ./composer.lock.${{ matrix.php }} ./composer.lock
- name: Enable UOPZ extension
run: phpenmod uopz
- name: Install dependencies via Composer
run: php ./composer.phar install --no-interaction --no-progress --prefer-dist --classmap-authoritative
- name: Create folder for coverage reports
run: mkdir -p ./spec_output
- name: Use unique phpspec.yml
if: matrix.has_unique_phpspec_tests
run: cp ./phpspec.yml.$(echo ${{ matrix.php }} | cut -d . -f 1) ./phpspec.yml
- name: Run PhpSpec tests
run: phpdbg -qrr ./vendor/phpspec/phpspec/bin/phpspec run
- name: Run Kahlan tests
run: phpdbg -qrr ./vendor/kahlan/kahlan/bin/kahlan
- name: Upload coverage to coveralls.io
if: matrix.upload_coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls -v