Merge pull request #538 from powerapi-ng/refactor/remove-redundant-op… #862
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: | |
run-tests: | |
name: Run linters and unit tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.x"] | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 | |
- name: Install dependencies | |
run: | | |
uv sync --extra everything --dev | |
- name: Run pylint | |
run: | | |
uv run pylint src/ tests/ | |
- name: Run ruff | |
run: | | |
uv run ruff check --output-format=github src/ tests/ | |
- name: Run unit tests with coverage | |
run: | | |
uv run pytest --cov=powerapi --cov-report=term --cov-report=xml tests/unit | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build-container-image: | |
name: Build container image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0 | |
- name: Build image | |
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0 | |
with: | |
push: false | |
provenance: false | |
load: true | |
tags: localbuild/powerapi:sha-${{ github.sha }} |