diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2fbf8a..6f45449 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: ./test.sh on: push: @@ -7,21 +7,67 @@ on: jobs: test: - name: ./test.sh + name: ${{ matrix.image || matrix.os }} + runs-on: ${{ matrix.runs-on }} strategy: fail-fast: false matrix: include: - - os: ubuntu-latest - arch: x86_64 - - os: ubuntu-latest - arch: aarch64 + # native (no docker) - os: macos-latest - arch: arm64 - runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || matrix.os }} + runs-on: macos-latest + + # the provided github actions runner images + # have tons of pre-installed packages. the + # goal here is to test across many vanilla setups + - 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 + - image: alpine:3.21 # musl libc + 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/setup-python@v6 + + # native (macOS) + - if: ${{ !matrix.image }} + uses: actions/setup-python@v6 with: python-version: "3.14" - - run: ./test.sh + - if: ${{ !matrix.image }} + name: ./test.sh + run: ./test.sh + + # docker (vanilla Linux) + - if: ${{ matrix.image }} + name: install python3 + run: | + docker build -t test -f - . <<'DOCKERFILE' + FROM ${{ matrix.image }} + RUN if command -v apk >/dev/null; then \ + apk add --no-cache python3 py3-pip bash curl; \ + elif command -v apt-get >/dev/null; then \ + apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv curl ca-certificates; \ + elif command -v dnf >/dev/null; then \ + dnf install -y python3 python3-pip curl; \ + elif command -v pacman >/dev/null; then \ + pacman -Sy --noconfirm python python-pip curl; \ + elif command -v zypper >/dev/null; then \ + zypper install -y python3 python3-pip curl; \ + elif command -v xbps-install >/dev/null; then \ + xbps-install -Sy python3 python3-pip bash curl; \ + fi + DOCKERFILE + - if: ${{ matrix.image }} + name: ./test.sh + run: docker run --rm -v "$PWD:/work" -w /work test bash ./test.sh diff --git a/gcc-arm-none-eabi/build.sh b/gcc-arm-none-eabi/build.sh index 8c984a8..411c3d6 100755 --- a/gcc-arm-none-eabi/build.sh +++ b/gcc-arm-none-eabi/build.sh @@ -37,9 +37,9 @@ URL="https://developer.arm.com/-/media/Files/downloads/gnu/${TOOLCHAIN_VERSION}/ echo "Downloading $TARBALL ..." curl -fSL -o "$TARBALL" "$URL" -# Extract +# Extract (use Python's lzma to avoid requiring xz-utils on the host) echo "Extracting ..." -tar xf "$TARBALL" +python3 -c "import lzma, tarfile; tarfile.open(fileobj=lzma.open('$TARBALL')).extractall()" EXTRACT_DIR=$(ls -d arm-gnu-toolchain-*-${PLATFORM_SUFFIX}-arm-none-eabi) SRC="$DIR/$EXTRACT_DIR"