use GitHub actions for CI and automate Sonarcloud analysis
This commit is contained in:
parent
5f3fd8b554
commit
0a3102ee38
54
.github/workflows/test.yml
vendored
Normal file
54
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: CI
|
||||||
|
on: push
|
||||||
|
jobs:
|
||||||
|
unit-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: [ '5.6', '7.3', '7.4', '8.0' ]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php }}
|
||||||
|
tools: composer
|
||||||
|
- name: Install
|
||||||
|
run: composer install --no-interaction
|
||||||
|
- name: Unit tests
|
||||||
|
run: |
|
||||||
|
composer test
|
||||||
|
sed -i "s#<file name=\"${GITHUB_WORKSPACE}#<file name=\"/github/workspace#g" tests-clover.xml
|
||||||
|
- name: Analyze with SonarCloud
|
||||||
|
if: matrix.php == '8.0'
|
||||||
|
uses: sonarsource/sonarcloud-github-action@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
with:
|
||||||
|
args: >
|
||||||
|
-Dsonar.organization=stklcode-github
|
||||||
|
-Dsonar.projectKey=stklcode:statify-blacklist
|
||||||
|
-Dsonar.sources=inc,views,statify-blacklist.php
|
||||||
|
-Dsonar.tests=test
|
||||||
|
-Dsonar.php.tests.reportPath=tests-junit.xml
|
||||||
|
-Dsonar.php.coverage.reportPaths=tests-clover.xml
|
||||||
|
-Dsonar.coverage.exclusions=test/**/*.php
|
||||||
|
|
||||||
|
quality:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.0'
|
||||||
|
tools: composer
|
||||||
|
- name: Install
|
||||||
|
run: composer install --no-interaction
|
||||||
|
- name: Code style checks for PHP
|
||||||
|
run: composer test-cs
|
13
.travis.yml
13
.travis.yml
@ -1,13 +0,0 @@
|
|||||||
language: php
|
|
||||||
php:
|
|
||||||
- '5.6'
|
|
||||||
- '7.3'
|
|
||||||
- '7.4'
|
|
||||||
- '8.0'
|
|
||||||
before_script:
|
|
||||||
- composer install
|
|
||||||
script:
|
|
||||||
- composer test-all
|
|
||||||
notifications:
|
|
||||||
slack:
|
|
||||||
secure: "ScXTSMO65veI1jA6TBHGDUtvDqEMkqJykaNf7vLLbb7YIxPIHHNBiX/wcjOHVFfQXZCV3qxQrflB7Lbm9qVUsAv861jTO9x/ZkECl5QhRoc0DIznejwZoypx0HJ9tBZFYT6qNUkViXRKZ/ILAiBLU9Yw52WACtQB9hu3FNFZwmKsjipvV8Sne1qEyTkLYLaMphsbC5mtXYdKMHvdt39jsYsk91UWGeYbXQ37LkMbsaG/8YHXF724d5JO7BRGoThw6p5knKAO5fk29V7GfNqg2h+hnGyNIUOcmxujgMDMFLyFCGMZpPoBa+3jyWWgq4PgpQt0F5VZtJFGoXCGcoMQm5IbVfqkSKJ4jYhqiSIrqSebLmzoPHepWX3yn8tpfOiBWjC6K9w9esp6vcZf26rnAJcjcGkA01rMrHRwR+UEMCLvj7q0DR0qzi/AFeED6gtpODzUf93Rp42Tz1iGvWIbgeCtkCWjfPO6XLuNiqGVPEVaT5BDKqlqbijdKxxp7yh1fdt8s0fInWdIsgoWTbU9DC1W4ZiqtQW7oYO+QtFZMaD6kZWpSqJUwB3kW5JL3odAUEm8bLbRWBvK5ZjGdaGqSbOs6f9gAKcf86iQQhwzCJSOgFlLlKFv9smicjPC+BGOxgx32pgseHNPWn6tmEo/ihmmr/NbbqoOusUKX9gQbA4="
|
|
@ -1,5 +1,5 @@
|
|||||||
[](https://travis-ci.com/stklcode/statify-blacklist)
|
[](https://github.com/stklcode/statify-blacklist/actions/workflows/test.yml?query=branch%3Astable)
|
||||||
[](https://sonarcloud.io/dashboard?id=stklcode%3Astatify-blacklist)
|
[](https://sonarcloud.io/dashboard?id=stklcode%3Astatify-blacklist)
|
||||||
[](https://packagist.org/packages/stklcode/statify-blacklist)
|
[](https://packagist.org/packages/stklcode/statify-blacklist)
|
||||||
[](https://github.com/stklcode/statify-blacklist/blob/stable/LICENSE.md)
|
[](https://github.com/stklcode/statify-blacklist/blob/stable/LICENSE.md)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user