Skip to content

Introduce SonarCloud #137

Introduce SonarCloud

Introduce SonarCloud #137

Workflow file for this run

name: Continuous Integration
on:
workflow_dispatch:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
jobs:
run-tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php: [ 8.1, 8.2 ]
laravel: [ 8.*, 9.*, 10.* ]
stability: [ prefer-stable ]
experimental: [ false ]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- php: 8.3
laravel: 10.*
testbench: 8.*
stability: prefer-stable
experimental: true
name: PHP ${{ matrix.php }} - L${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install dependencies
if: "${{ matrix.experimental == false }}"
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Install dependencies (experimental)
if: "${{ matrix.experimental == true }}"
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev --ignore-platform-reqs
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ignore-platform-reqs
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Execute tests (Unit and Feature)
run: vendor/bin/phpunit --log-junit=reports/report-phpunit.xml --coverage-clover=reports/coverage-phpunit.xml
- name: Static analysis with PHPStan
run: vendor/bin/phpstan analyse --error-format=json > reports/phpstan.json
- name: Static analysis with Psalm
if: "${{ matrix.experimental == false }}"
run: vendor/bin/psalm
- name: Coding style PSR12 Check
run: vendor/bin/phpcs
- name: Run SonarCloud scanner
uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/sonarcloud@main
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}