Merge pull request #167 from powerapi-ng/dependabot/github_actions/do… #331
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@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.xml |