forked from OpenMage/magento-lts
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (60 loc) · 2.07 KB
/
sonar.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: OpenMage LTS - Sonar - Full Analyses
on:
# Run on all pushes and on all pull requests.
# Prevent the build from running when there are only irrelevant changes.
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
types: [opened, synchronize, reopened]
jobs:
unit:
name: Unit Tests on ${{ matrix.php }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest]
php: ['7.4', '8.1']
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
tools: composer, pecl, phpcs, phpstan, phpunit:9.5
ini-values: pcov.directory=api, post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: pcov #optional, setup coverage driver
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare
run: |
php -v
composer --version
composer install --dev -n --prefer-source --ignore-platform-req=php
- name: Run Unit Tests
run: phpunit --configuration ./dev/phpunit.xml.dist --testsuite=Unit;
- name: prepare SonarCloud Scan Data
continue-on-error: true
if: ${{ matrix.php == '8.1' }}
run: |
echo $PWD
ls -la
head ./dev/tests/clover.xml
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' ./dev/tests/junit.xml
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' ./dev/tests/clover.xml
head ./dev/tests/clover.xml
ls -la
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
continue-on-error: true
if: ${{ matrix.php == '8.1' }} && SONAR_TOKEN
with:
args: >
-Dproject.settings=dev/sonar-project.properties
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}