fix & test on vanilla linux distros (#2)
* fix & test on vanilla linux distros * add alpine and opensuse * merge * and void of course * cleanup the logs * need bash
This commit is contained in:
66
.github/workflows/test.yml
vendored
66
.github/workflows/test.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: test
|
name: ./test.sh
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -7,21 +7,67 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: ./test.sh
|
name: ${{ matrix.image || matrix.os }}
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
# native (no docker)
|
||||||
arch: x86_64
|
|
||||||
- os: ubuntu-latest
|
|
||||||
arch: aarch64
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
arch: arm64
|
runs-on: macos-latest
|
||||||
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || matrix.os }}
|
|
||||||
|
# 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:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
|
# native (macOS)
|
||||||
|
- if: ${{ !matrix.image }}
|
||||||
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.14"
|
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
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ URL="https://developer.arm.com/-/media/Files/downloads/gnu/${TOOLCHAIN_VERSION}/
|
|||||||
echo "Downloading $TARBALL ..."
|
echo "Downloading $TARBALL ..."
|
||||||
curl -fSL -o "$TARBALL" "$URL"
|
curl -fSL -o "$TARBALL" "$URL"
|
||||||
|
|
||||||
# Extract
|
# Extract (use Python's lzma to avoid requiring xz-utils on the host)
|
||||||
echo "Extracting ..."
|
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)
|
EXTRACT_DIR=$(ls -d arm-gnu-toolchain-*-${PLATFORM_SUFFIX}-arm-none-eabi)
|
||||||
|
|
||||||
SRC="$DIR/$EXTRACT_DIR"
|
SRC="$DIR/$EXTRACT_DIR"
|
||||||
|
|||||||
Reference in New Issue
Block a user