Merge pull request #721 from powerapi-ng/test/fix-deadlock-forkserver #1243
This file contains hidden or 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@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 --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@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.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@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Build image | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| push: false | |
| provenance: false | |
| load: true | |
| tags: localbuild/powerapi:sha-${{ github.sha }} | |
| build-args: | | |
| POWERAPI_INSTALL_METHOD=local |