Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CI/CD for sonarqube analysis #20

Merged
merged 10 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: push
name: Sonarqube
jobs:
sonarQubeTrigger:
name: SonarQube Trigger
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.branch.name=${{ github.ref_name }}
env:
SONAR_TOKEN: "0052493ad45d69d2bc55d9bd64e9f8cc9da0bec0"
SONAR_HOST_URL: "https://pmpl.cs.ui.ac.id/sonarqube"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/vendor/
composer.lock
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"autoload": {
"psr-4": {
"Uasoft\\Badaso\\Module\\LMSModule\\": "src/",
"Uasoft\\Badaso\\Module\\LMSModule\\Seeders": "src/seeders"
"Uasoft\\Badaso\\Module\\LMSModule\\Seeders\\": "src/seeders"
Copy link

@AldiNFitrah AldiNFitrah Mar 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I made a mistake here, it should be "src/Seeders", could you please change it

}
},
"autoload-dev": {
Expand Down
2 changes: 2 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sonar.projectKey=ppl2022-d-uasoft_lms_module
sonar.sources=src/
8 changes: 4 additions & 4 deletions src/Commands/LMSModuleSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LMSModuleSetup extends Command {
*
* @var string
*/
protected $name = 'badaso-lms:setup';
protected $name = 'badaso-lms-module:setup';

/**
* The console command description.
Expand Down Expand Up @@ -74,7 +74,7 @@ protected function addBadasoEnv() {
$new_env_adding = [];
foreach ($env_will_adding as $key_add_env => $val_add_env) {
$status_adding = true;
foreach ($arr_env_file as $key_env_file => $val_env_file) {
foreach ($arr_env_file as $val_env_file) {
$val_env_file = trim($val_env_file);
if (substr($val_env_file, 0, 1) != '#' && $val_env_file != '' && strstr($val_env_file, $key_add_env)) {
$status_adding = false;
Expand All @@ -86,7 +86,7 @@ protected function addBadasoEnv() {
}
}

foreach ($new_env_adding as $index_env_add => $val_env_add) {
foreach ($new_env_adding as $val_env_add) {
$arr_env_file[] = $val_env_add;
}

Expand All @@ -105,7 +105,7 @@ protected function addLMSTablesToHiddenTables() {
$config_hidden_tables = require $config_path;
$tables = LMSModule::getProtectedTables();

foreach ($tables as $key => $value) {
foreach ($tables as $value) {
if (! in_array($value, $config_hidden_tables)) {
array_push($config_hidden_tables, $value);
}
Expand Down
20 changes: 0 additions & 20 deletions tests/Feature/ExampleTest.php

This file was deleted.