Skip to content

Merge branch 'main' of github.com:pdreker/fritz_exporter #666

Merge branch 'main' of github.com:pdreker/fritz_exporter

Merge branch 'main' of github.com:pdreker/fritz_exporter #666

Workflow file for this run

name: Run Tests
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
run-checks:
runs-on: ubuntu-latest
name: Run Unit Tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.PYTHON_VERSION }}
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ vars.POETRY_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
poetry install
- name: Lint with flake8
id: flake8
continue-on-error: true
run: |
poetry run flake8 . | tee lint.log
rescode=${PIPESTATUS[0]}
echo "::set-output name=lint::$(cat lint.log)"
exit $rescode
- name: Run pytest
id: pytest
continue-on-error: true
run: |
poetry run python -m pytest --cov=. --cov-report=xml --cov-config=.coveragerc . | tee test.log
rescode=${PIPESTATUS[0]}
echo "::set-output name=tests::$(cat test.log)"
exit $rescode
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}