make Python CI reusable
This commit is contained in:
parent
8025fcbcc3
commit
a65a518f87
12
.github/workflows/ci-python.yml
vendored
12
.github/workflows/ci-python.yml
vendored
@ -2,9 +2,6 @@ name: Python CI
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
# env:
|
|
||||||
# REPO_NAME:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -18,16 +15,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install -r requirements.txt && pip install -r requirements-dev.txt
|
run: |
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install -r requirements-dev.txt
|
||||||
|
pip install pylint-exit
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: pylint --recursive=yes --output-format=parseable --output=lintreport.txt . || pylint-exit $?
|
run: pylint --recursive=yes --output-format=parseable --output=lintreport.txt . || pylint-exit $?
|
||||||
- name: Unit Test
|
- name: Unit Test
|
||||||
run: |
|
run: |
|
||||||
coverage run -m py.test -v --junitxml=testresults.xml
|
coverage run -m py.test -v --junitxml=testresults.xml
|
||||||
coverage xml
|
coverage xml
|
||||||
# sed -i 's/\/home\/runner\/work\/pypilot\/pypilot/\/github\/workspace/g' coverage.xml
|
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
|
||||||
- name: SonarCloud Scan
|
- name: SonarCloud Scan
|
||||||
uses: SonarSource/sonarcloud-github-action@master
|
uses: SonarSource/sonarcloud-github-action@master
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLOUD }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLOUD }}
|
||||||
|
Loading…
Reference in New Issue
Block a user