Skip to content

Commit

Permalink
Adding main.yml and sonarcloud properties to hyva (#56)
Browse files Browse the repository at this point in the history
* Adding main.yml and sonarcloud properties to hyva

* Debugging

* Removing phpcs

* Removing php unit tests

* Removing php unit tests

* Update .github/workflows/main.yml

Removing scan on pull_request_target

Co-authored-by: Can Demiralp <[email protected]>

---------

Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Peter Ojo <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2024
1 parent 428f51e commit 0ad4c40
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Main CI workflow

on:
pull_request:
workflow_dispatch:

jobs:
build:
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_dispatch')
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }}
runs-on: ubuntu-latest

strategy:
matrix:
php-version: [8.2,8.3]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v1

- name: SonarCloud Scan
if: ${{ env.SONAR_TOKEN }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.organization=adyen
sonar.projectKey=Adyen_adyen-magento2-hyva
sonar.sources=.
sonar.exclusions=vendor/**/*, Test/**/*, view/**/*
sonar.php.coverage.reportPaths=build/clover.xml
sonar.php.tests.reportPath=build/tests-log.xml

0 comments on commit 0ad4c40

Please sign in to comment.