Skip to content

Commit

Permalink
SonarCloud CI-based analysis
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
cutwater committed Oct 7, 2024
1 parent b2ddd87 commit af3462b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/ci_full.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
name: galaxy_ng/ci
on: {pull_request: {branches: ['**']}, push: {branches: ['**']}}
on:
pull_request:
branches: ['**']
push:
branches: ['**']

jobs:

Expand Down Expand Up @@ -73,18 +77,22 @@ jobs:
- name: run the unit test playbook
run: cd dev/playbooks; ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i 'localhost,' --forks=1 -v run_unit_tests.yaml

- name: copy coverage report
run: |
docker cp pulp:/tmp/galaxy_ng-test-results.xml coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: upload jUnit XML test results
if: github.event_name == 'push' && github.repository == 'ansible/galaxy_ng' && github.ref_name == 'master'
continue-on-error: true
run: >-
docker exec pulp /bin/bash -c 'curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}"
--form "xunit_xml=@/tmp/galaxy_ng-test-results.xml"
--form "component_name=hub"
--form "git_commit_sha=${{ github.sha }}"
--form "git_repository_url=https://github.com/${{ github.repository }}"
"${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"'
# FIXME: do we really care about these anymore ... ?
#- name: run the functional test playbook
# run: cd dev/playbooks; ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i 'localhost,' --forks=1 -v run_functional_tests.yaml
run: |
curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \
--form "[email protected]" \
--form "component_name=hub" \
--form "git_commit_sha=${{ github.sha }}" \
--form "git_repository_url=https://github.com/${{ github.repository }}" \
"${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"
5 changes: 5 additions & 0 deletions .sonarcloud.properties → sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
sonar.projectKey = ansible_galaxy_ng
sonar.organization = ansible

sonar.sources = galaxy_ng
sonar.exclusions = \
galaxy_ng/tests/**, \
Expand All @@ -6,3 +9,5 @@ sonar.exclusions = \
sonar.tests = galaxy_ng/tests

sonar.python.version = 3.11

sonar.python.coverage.reportPaths = coverage.xml

0 comments on commit af3462b

Please sign in to comment.