Files
dependencies/.github/workflows/test.yml
2026-02-22 19:06:33 -08:00

93 lines
3.0 KiB
YAML

name: ci
on:
push:
branches: [master]
pull_request:
jobs:
build:
name: build (${{ matrix.platform }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- platform: macos
runs-on: macos-latest
- platform: linux-x86_64
runs-on: ubuntu-latest
- platform: linux-arm64
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install build dependencies
run: ./setup.sh
- name: Build wheels
run: |
for pkg in */pyproject.toml; do
pip wheel "./$(dirname "$pkg")" --no-deps --wheel-dir dist/
done
- name: Smoketest locally
run: bash smoketest.sh dist/
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform }}
path: dist/*.whl
test:
name: test (${{ matrix.image }})
needs: build
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
# test on vanilla linux images
- image: debian:bookworm-slim
runs-on: ubuntu-latest
- image: ubuntu:24.04
runs-on: ubuntu-latest
- image: fedora:41
runs-on: ubuntu-latest
- image: archlinux:latest
runs-on: ubuntu-latest
# TODO: make musl work
#- image: alpine:3.21
# runs-on: ubuntu-latest
- image: opensuse/tumbleweed:latest
runs-on: ubuntu-latest
- image: ghcr.io/void-linux/void-glibc:latest
runs-on: ubuntu-latest
- image: debian:bookworm-slim
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v4
with:
name: wheels-${{ contains(matrix.runs-on, 'arm') && 'linux-arm64' || 'linux-x86_64' }}
path: wheels
- name: build docker
run: |
docker build -t smoketest -f - . <<'DOCKERFILE'
FROM ${{ matrix.image }}
RUN if command -v apk >/dev/null; then \
apk add --no-cache python3 py3-pip bash; \
elif command -v apt-get >/dev/null; then \
apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv; \
elif command -v dnf >/dev/null; then \
dnf install -y python3 python3-pip; \
elif command -v pacman >/dev/null; then \
pacman -Sy --noconfirm python python-pip; \
elif command -v zypper >/dev/null; then \
zypper install -y python3 python3-pip; \
elif command -v xbps-install >/dev/null; then \
xbps-install -Sy python3 python3-pip bash; \
fi
DOCKERFILE
- name: ./smoketest.sh
run: docker run --rm -v "$PWD:/work" -w /work smoketest bash smoketest.sh wheels/