Skip to content

Updated test versions #33

Updated test versions

Updated test versions #33

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [7.4]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-version }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-scripts
- name: Run test suite
run: composer run-script test
- name: Fix paths for Sonar
if: matrix.php-version == '7.4'
working-directory: ./build/reports/
run: sed -i 's/\/home\/runner\/work\/common-bundle\/common-bundle\//\/github\/workspace\//g' phpunit.coverage.xml
- name: SonarCloud Scan
if: matrix.php-version == '7.4'
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}