Skip to content

ci: change ci workflow to tests, configure sonar cloud #2

ci: change ci workflow to tests, configure sonar cloud

ci: change ci workflow to tests, configure sonar cloud #2

Workflow file for this run

name: "Tests"
on:
pull_request:
branches:
- "*.x"
paths:
- .github/workflows/tests.yml
- composer.*
- src/**
- tests/**
- phpunit.xml.dist
push:
branches:
- "*.x"
paths:
- .github/workflows/tests.yml
- composer.*
- src/**
- tests/**
- phpunit.xml.dist
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
fail-fast: true
permissions:
contents: read
jobs:
build:
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: ${{ matrix.php-versions }}
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run tests
run: vendor/bin/phpunit --colors=always --coverage-clover=coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}