2023-02-28 17:07:11 +01:00
|
|
|
name: Python CI
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.11"
|
|
|
|
- name: Install dependencies
|
2023-02-28 17:13:14 +01:00
|
|
|
run: |
|
|
|
|
pip install -r requirements.txt
|
|
|
|
pip install -r requirements-dev.txt
|
|
|
|
pip install pylint-exit
|
2023-02-28 17:07:11 +01:00
|
|
|
- name: Lint
|
|
|
|
run: pylint --recursive=yes --output-format=parseable --output=lintreport.txt . || pylint-exit $?
|
|
|
|
- name: Unit Test
|
|
|
|
run: |
|
|
|
|
coverage run -m py.test -v --junitxml=testresults.xml
|
|
|
|
coverage xml
|
2023-02-28 17:13:14 +01:00
|
|
|
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
|
2023-02-28 17:07:11 +01:00
|
|
|
- name: SonarCloud Scan
|
|
|
|
uses: SonarSource/sonarcloud-github-action@master
|
|
|
|
env:
|
2023-02-28 17:13:14 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-28 17:07:11 +01:00
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLOUD }}
|