Merge pull request #171 from powerapi-ng/refactor/ruff-unsorted-dunde… #337
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: Build | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
permissions: | |
contents: read | |
jobs: | |
build-and-test: | |
name: Build project and run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.x"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[devel]" | |
- name: Lint with Ruff | |
run: | | |
ruff check src/ tests/ | |
- name: Static code analysis with pylint | |
run: | | |
pylint src/ tests/ | |
- name: Test with pytest | |
run: | | |
pytest --cov=smartwatts --cov-report=term --cov-report=xml tests/unit | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.xml |