Skip to content

Build

Build #1423

Workflow file for this run

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.12", "3.x"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- name: Install dependencies
run: |
uv sync --extra everything --dev
- 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@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
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@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Build image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
push: false
provenance: false
load: true
tags: localbuild/powerapi:sha-${{ github.sha }}
build-args: |
POWERAPI_INSTALL_METHOD=local