Skip to content

Commit

Permalink
Add sonar cloud analyzer to pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
DvDty committed Jan 28, 2024
1 parent 2b0c77a commit 5ac02a6
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 67 deletions.
144 changes: 78 additions & 66 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,78 +26,90 @@ jobs:
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

linter:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ./application/vendor
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: none

- name: Install Project Dependencies
working-directory: ./application
run: composer install

- name: Run linter
working-directory: ./application
run: ./vendor/bin/php-cs-fixer fix app/

- name: Commit linted files
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix code styling
# linter:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Cache dependencies
# uses: actions/cache@v2
# with:
# path: ./application/vendor
# key: composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# composer-
#
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# tools: composer:v2
# coverage: none
#
# - name: Install Project Dependencies
# working-directory: ./application
# run: composer install
#
# - name: Run linter
# working-directory: ./application
# run: ./vendor/bin/php-cs-fixer fix app/
#
# - name: Commit linted files
# id: auto-commit-action
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: Fix code styling
#
# tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Cache dependencies
# uses: actions/cache@v2
# with:
# path: ./application/vendor
# key: composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# composer-
#
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# tools: composer:v2
# coverage: none
#
# - name: Install Project Dependencies
# working-directory: ./application
# run: composer install
#
# - name: Framework configuration
# working-directory: ./application
# run: |
# cp .env.example .env
# php artisan key:generate
# php artisan config:clear
#
# - name: Run tests
# working-directory: ./application
# run: php artisan test

tests:
SonarCloud:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ./application/vendor
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: none

- name: Install Project Dependencies
working-directory: ./application
run: composer install

- name: Framework configuration
working-directory: ./application
run: |
cp .env.example .env
php artisan key:generate
php artisan config:clear
- name: Run tests
working-directory: ./application
run: php artisan test
- name: Analyze
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

# build-check-push-image:
# runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

![img_1.png](img_1.png)

![img_2.png](img_2.png)
![img_2.png](img_2.png)

![img_3.png](img_3.png)
Binary file added img_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5ac02a6

Please sign in to comment.