42 lines
1.2 KiB
YAML
Raw Normal View History

2022-07-10 14:57:40 +01:00
name: CI
on:
2022-08-13 22:37:53 +01:00
push:
branches: [ main ]
2022-07-10 14:57:40 +01:00
pull_request:
2022-08-13 22:37:53 +01:00
types: [opened, synchronize, reopened]
2022-07-10 14:57:40 +01:00
paths-ignore:
- 'README.md'
- 'LICENSE.md'
- '.gitignore'
- 'CODEOWNERS'
- 'renovate.json'
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
2023-01-10 23:11:02 +00:00
ref: ${{ github.event.pull_request.head.sha }}
2022-07-10 17:30:41 +01:00
fetch-depth: 0
2022-07-10 14:57:40 +01:00
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: Lint
run: pylint --recursive=yes --output-format=parseable --output=lintreport.txt . || pylint-exit $?
2023-01-10 23:11:02 +00:00
continue-on-error: true
- name: Unit Test
2022-07-10 14:57:40 +01:00
run: |
2023-01-10 23:11:02 +00:00
coverage run -m pytest -v --junitxml=testresults.xml
2022-07-10 14:57:40 +01:00
coverage xml
2023-01-10 23:11:02 +00:00
sed -i 's/\/home\/runner\/work\/pypilot\/pypilot/\/github\/workspace/g' coverage.xml
2022-08-13 22:37:53 +01:00
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
2023-01-10 23:11:02 +00:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-08-13 22:37:53 +01:00
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLOUD }}