You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.5 KiB
69 lines
1.5 KiB
name: Build and Test
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check-and-test:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
UV_FROZEN: 1
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Set up latest uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
version: "latest"
|
|
|
|
- name: Set up project environment
|
|
run: |
|
|
uv sync
|
|
uv pip install --no-deps -e .
|
|
|
|
- name: Run ruff linter
|
|
run: uv run ruff check
|
|
|
|
- name: Run black formatter
|
|
run: uv run black --check .
|
|
|
|
- name: Run pyright static analysis
|
|
run: uv run pyright
|
|
|
|
- name: Run coverage test
|
|
run: |
|
|
uv run coverage run -m pytest
|
|
uv run coverage report
|
|
|
|
build-images:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build multi-arch images
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|