Skip to content

Merge pull request #260 from powerapi-ng/dependabot/github_actions/do… #508

Merge pull request #260 from powerapi-ng/dependabot/github_actions/do…

Merge pull request #260 from powerapi-ng/dependabot/github_actions/do… #508

Workflow file for this run

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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
- name: Install dependencies
run: |
uv sync --dev
- name: Lint with Ruff
run: |
uv run ruff check src/ tests/
- name: Static code analysis with pylint
run: |
uv run pylint src/ tests/
- name: Test with pytest
run: |
uv run pytest --cov=smartwatts --cov-report=term --cov-report=xml tests/unit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml