Add exempt
label
#250
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: ~ | |
env: | |
DEFAULT_PYTHON: "3.12" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
name: Check style formatting | |
steps: | |
- name: Check out code from GitHub | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Check code formatting with black | |
uses: psf/black@stable | |
- name: Check code formatting with isort | |
uses: isort/isort-action@master | |
with: | |
requirementsFiles: "requirements.txt requirements_dev.txt" | |
tests: | |
runs-on: ubuntu-latest | |
name: Run tests | |
steps: | |
- name: Check out code from GitHub | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Install requirements | |
run: | | |
python3 -m pip install -r requirements.txt | |
python3 -m pip install -r requirements_dev.txt | |
- name: Run tests | |
run: | | |
pytest \ | |
-qq \ | |
--timeout=9 \ | |
--durations=10 \ | |
-n auto \ | |
--cov custom_components.kamstrup_403 \ | |
--cov-report=term \ | |
--cov-report=xml \ | |
-o console_output_style=count \ | |
-p no:sugar \ | |
tests | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
- name: SonarCloud Scan | |
if: github.event.pull_request.head.repo.fork == false | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |