diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f528858..03df9ee 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,13 +6,18 @@ on: jobs: build: + strategy: + matrix: + image: [ "ubuntu:latest", "ubuntu:22.04", "archlinux:latest" ] runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} steps: - name: Check out repository code uses: actions/checkout@v4 - name: Prepare build environment - run: ./prepare.sh -us | tee -a "$GITHUB_ENV" + run: ./prepare.sh -u | tee -a "$GITHUB_ENV" - name: Build run: make build diff --git a/prepare.sh b/prepare.sh index c1dadcf..31bc5a9 100755 --- a/prepare.sh +++ b/prepare.sh @@ -18,16 +18,26 @@ done shift $((OPTIND-1)) if [ -z "$DISTRO" ]; then - DISTRO=$(lsb_release -is) + if command -v lsb_release; then + DISTRO=$(lsb_release -is) + elif command -v pacman >/dev/null; then + DISTRO="Arch" + elif command -v apt-get >/dev/null; then + # TODO: debian + DISTRO="Ubuntu" + else + echo "unable to figure out distribution: $DISTRO" 1>&2 + exit 1 + fi fi echo "distro: $DISTRO" 1>&2 -if [ "$DISTRO" = "Arch" ]; then +if [ "$DISTRO" = "Arch" ] || command -v pacman >/dev/null; then if [ -n "$UPDATE" ]; then $SUDO pacman -Sy fi $SUDO pacman -S lua libxrandr -elif [ "$DISTRO" = "Ubuntu" ]; then +elif [ "$DISTRO" = "Ubuntu" ] || command -v apt-get >/dev/null; then if [ -n "$UPDATE" ]; then $SUDO apt-get update 1>&2 fi