-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New CI self hosted SonarQube & self hosted action runners (#33)
* new_ci: init new CI * new_ci: added sonarqube file
- Loading branch information
Showing
3 changed files
with
45 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,48 @@ | ||
name: CI | ||
name: CI+ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
- '**' # matches every branch | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
|
||
jobs: | ||
tests: | ||
runs-on: mysiar | ||
build: | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
php: ['7.2', '7.3', '7.4', '8.0', '8.1'] | ||
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] | ||
steps: | ||
- name: Setup PHP (PHP ${{ matrix.php }}) | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: xdebug | ||
tools: composer | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Composer dependencies | ||
run: composer install | ||
- name: PHPUnit tests (PHP ${{ matrix.php }}) | ||
run: php${{ matrix.php }} ./vendor/bin/phpunit --testdox --verbose --stop-on-failure | ||
- uses: symfonycorp/security-checker-action@v3 | ||
- name: Coding standard (PHP ${{ matrix.php }}) | ||
run: php${{ matrix.php }} ./vendor/bin/ecs check src tests | ||
- name: PHPUnit tests (PHP ${{ matrix.php }}) | ||
run: php${{ matrix.php }} ./vendor/bin/phpunit --testdox --verbose --stop-on-failure | ||
- name: Code coverage | ||
run: php${{ matrix.php }} -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=var/coverage.xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./var/coverage.xml | ||
fail_ci_if_error: true | ||
- name: Display the vulnerabilities as JSON | ||
run: echo ${{ steps.security-check.outputs.vulns }} | ||
- name: Fix code coverage paths | ||
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' var/coverage.xml | ||
- name: Analyze with SonarQube | ||
uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
# If you wish to fail your job when the Quality Gate is red, uncomment the | ||
# following lines. This would typically be used to fail a deployment. | ||
# - uses: sonarsource/sonarqube-quality-gate-action@master | ||
# timeout-minutes: 5 | ||
# env: | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sonar.projectKey=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc | ||
sonar.sources=src/ | ||
sonar.tests=tests/ | ||
sonar.verbose=true | ||
sonar.php.coverage.reportPaths=var/coverage.xml |