Skip to content

Commit

Permalink
Migrate SonarCloud pipeline to Github Actions. (AcademySoftwareFounda…
Browse files Browse the repository at this point in the history
  • Loading branch information
bcipriano authored Sep 1, 2020
1 parent 526efee commit d539d8d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 40 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/sonar-cloud-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: OpenCue SonarCloud Pipeline

# Trigger this pipeline on new commits to master.
on:
push:
branches: [ master ]

jobs:
analyze_python:
runs-on: ubuntu-latest
container: aswf/ci-opencue:2020
name: Analyze Python Components
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Fetch all Git history, otherwise the current version number will
# not be correctly calculated.
fetch-depth: 0

- name: Generate coverage report
run: ci/python_coverage_report.sh

- name: Analyze and send to SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

analyze_cuebot:
runs-on: ubuntu-latest
container: aswf/ci-opencue:2020
name: Analyze Cuebot
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Fetch all Git history, otherwise the current version number will
# not be correctly calculated.
fetch-depth: 0

- name: Analyze and send to SonarCloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
chown -R aswfuser:aswfgroup .
su -c "cd cuebot && ./gradlew jacocoTestReport sonarqube -Dsonar.login=$(SONAR_TOKEN)" aswfuser
2 changes: 2 additions & 0 deletions ci/python_coverage_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pip install --user -r requirements.txt -r requirements_gui.txt
# Protos need to have their Python code generated in order for tests to pass.
python -m grpc_tools.protoc -I=proto/ --python_out=pycue/opencue/compiled_proto --grpc_python_out=pycue/opencue/compiled_proto proto/*.proto
python -m grpc_tools.protoc -I=proto/ --python_out=rqd/rqd/compiled_proto --grpc_python_out=rqd/rqd/compiled_proto proto/*.proto
2to3 -wn -f import pycue/opencue/compiled_proto/*_pb2*.py
2to3 -wn -f import rqd/rqd/compiled_proto/*_pb2*.py

# Run coverage for each component individually, but append it all into the same report.
coverage run --source=pycue/opencue/,pycue/FileSequence/ --omit=pycue/opencue/compiled_proto/* pycue/setup.py test
Expand Down
40 changes: 0 additions & 40 deletions ci/sonar-cloud-pipeline.yml

This file was deleted.

0 comments on commit d539d8d

Please sign in to comment.