From 29300e30649808f165a67897c8fb0a7866762553 Mon Sep 17 00:00:00 2001 From: Felipe Figueroa Date: Tue, 27 Apr 2021 00:58:44 -0400 Subject: [PATCH] adds codecov last chance for scrutinizer --- .github/workflows/coverage.yml | 28 ++++- .scrutinizer.yml | 4 +- Examples/example_parser.js | 189 +++++++++++++++------------------ README.md | 3 +- sonar-project.properties | 14 +++ 5 files changed, 130 insertions(+), 108 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 37e88c2d..bf572ecf 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,8 +1,23 @@ name: coverage -on: ['pull_request'] - +on: + push: + branches: [ master ] + pull_request: + types: [opened, synchronize, reopened] jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} coverage: runs-on: 'ubuntu-latest' strategy: @@ -42,4 +57,11 @@ jobs: - name: Coverage run: composer coverage - if: "matrix.php == 7.4" \ No newline at end of file + if: "matrix.php == 7.4" + + + - uses: codecov/codecov-action@v1 + with: + files: ./tests/_output/coverage.xml + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) \ No newline at end of file diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 2cdd54dd..1dcbb1b1 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -4,8 +4,8 @@ build: environment: php: version: '7.4' - ini: - 'zend_extension': 'xdebug.so' + + nodes: tests: true analysis: diff --git a/Examples/example_parser.js b/Examples/example_parser.js index efe3d3a8..3e71627e 100755 --- a/Examples/example_parser.js +++ b/Examples/example_parser.js @@ -1,111 +1,96 @@ var files_arr = JSON.parse(window.files); -var filesmenu = _.reduce( - files_arr, - function(accum, file) { - var foldername = file - .split("/")[0] - .split("_") - .join(" "), - folder = file.split("/")[0], - testName = folder.split("_")[1], - testName = - "tests/" + - testName[0].toUpperCase() + - testName.substring(1) + - "Test.php"; - accum[folder] = accum[folder] || { - foldername: foldername, - examples: [] - }; - accum[folder].examples.push(file); - return accum; - }, - {} -); +let filesmenu = _.reduce( + files_arr, + function (accum, file) { + let foldername = file.split("/")[0].split("_").join(" "), + folder = file.split("/")[0]; -jQuery(document).ready(function() { - var createCard = function(index, title) { - var card = jQuery('
'); - var card_header = jQuery( - '