Skip to content

Commit

Permalink
More CI fixups
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Dec 5, 2023
1 parent b7f9993 commit 3f5164a
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 37 deletions.
52 changes: 36 additions & 16 deletions .github/workflows/bootstrap-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,61 @@ if [ x"${1}" = x"" ]; then
exit 1
fi

EMSCRIPTEN_VERSION=${EMSCRIPTEN_VERSION:=latest}

function get_linux_deb_arch() {
case "${1}" in
"linux-aarch64") echo "arm64" ;;
"linux-armhf") echo "armhf" ;;
"linux-i686") echo "i386" ;;
"linux-riscv64") echo "riscv64" ;;
"linux-x86_64") echo "amd64" ;;
"win32"|"win64") echo "i386" ;;
esac
}

function install_compiler() {
case "${1}" in
"linux-aarch64")
apt-get install -yqq g++-aarch64-linux-gnu
if [ "$(uname -m)" != "aarch64" ]; then
apt-get install -yqq g++-aarch64-linux-gnu
else
apt-get install -yqq g++
fi
;;
"linux-armhf")
apt-get install -yqq g++-arm-linux-gnueabihf
if [ "$(uname -m)" != "armhf" ]; then
apt-get install -yqq g++-arm-linux-gnueabihf
else
apt-get install -yqq g++
fi
;;
"linux-i686")
apt-get install -yqq g++-i686-linux-gnu
if [ "$(uname -m)" != "i686" ]; then
apt-get install -yqq g++-i686-linux-gnu
else
apt-get install -yqq g++
fi
;;
"linux-riscv64")
apt-get install -yqq g++-riscv64-linux-gnu
if [ "$(uname -m)" != "riscv64" ]; then
apt-get install -yqq g++-riscv64-linux-gnu
else
apt-get install -yqq g++
fi
;;
"linux-x86_64")
# FIXME this assumes build runner is x86_64
apt-get install -yqq g++
;;
"wasm")
[ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk
cd ~/PawPawBuilds/emsdk && ./emsdk install ${EMSCRIPTEN_VERSION} && ./emsdk activate ${EMSCRIPTEN_VERSION}
if [ "$(uname -m)" != "x86_64" ]; then
apt-get install -yqq g++-x86_64-linux-gnu
else
apt-get install -yqq g++
fi
;;
"win32")
dpkg --add-architecture i386
apt-get update -qq
apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable
;;
"win64")
dpkg --add-architecture i386
apt-get update -qq
apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable
;;
esac
Expand All @@ -54,12 +70,14 @@ function install_compiler() {
case "${1}" in
"macos"|"macos-universal"|"macos-universal-10.15")
brew install cmake git jq meson

[ -n "${GITHUB_ENV}" ] && echo "PAWPAW_PACK_NAME=${1}-$(sw_vers -productVersion)" >> "${GITHUB_ENV}"
;;
*)
sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
sed -i "s/deb mirror/deb [arch=amd64] mirror/" /etc/apt/sources.list
sed -i "s/deb http/deb [arch=i386,amd64] http/" /etc/apt/sources.list
sed -i "s/deb mirror/deb [arch=i386,amd64] mirror/" /etc/apt/sources.list
apt-get update -qq
apt-get install -yqq autoconf automake autopoint binfmt-support build-essential curl cmake git jq lsb-release meson gperf qemu-user-static
apt-get install -yqq autoconf automake autopoint binfmt-support build-essential curl cmake git jq lsb-release meson gperf patchelf qemu-user-static

arch=$(get_linux_deb_arch "${1}")
release=$(lsb_release -cs)
Expand All @@ -76,5 +94,7 @@ case "${1}" in
fi

install_compiler "${1}"

[ -n "${GITHUB_ENV}" ] && echo "PAWPAW_PACK_NAME=${1}-${release}" >> "${GITHUB_ENV}"
;;
esac
73 changes: 52 additions & 21 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

env:
CACHE_VERSION: 3
CACHE_VERSION: 1
DEBIAN_FRONTEND: noninteractive
EMSCRIPTEN_VERSION: 3.1.27
PAWPAW_SKIP_TESTS: 1
Expand All @@ -14,36 +14,70 @@ jobs:
strategy:
matrix:
include:
# macos
- target: macos
os: macos-11
- target: macos-universal
os: macos-11
- target: macos-universal-10.15
os: macos-11
# ubuntu:18.04
- target: linux-aarch64
container: ubuntu:18.04
os: ubuntu-latest
container: ubuntu:22.04
- target: linux-armhf
container: ubuntu:18.04
os: ubuntu-latest
container: ubuntu:22.04
- target: linux-i686
container: ubuntu:18.04
os: ubuntu-latest
#- target: linux-riscv64
#container: ubuntu:18.04
#os: ubuntu-latest
- target: linux-x86_64
container: ubuntu:18.04
os: ubuntu-latest
# ubuntu:20.04
- target: linux-aarch64
container: ubuntu:20.04
os: ubuntu-latest
- target: linux-armhf
container: ubuntu:20.04
os: ubuntu-latest
- target: linux-i686
container: ubuntu:20.04
os: ubuntu-latest
container: ubuntu:22.04
- target: linux-riscv64
container: ubuntu:20.04
os: ubuntu-latest
container: ubuntu:22.04
- target: linux-x86_64
container: ubuntu:20.04
os: ubuntu-latest
# ubuntu:22.04
- target: linux-aarch64
container: ubuntu:22.04
- target: macos
os: macos-11
- target: macos-universal
os: macos-11
- target: macos-universal-10.15
os: macos-11
- target: wasm
os: ubuntu-latest
- target: linux-armhf
container: ubuntu:22.04
- target: win32
os: ubuntu-latest
- target: linux-i686
container: ubuntu:22.04
os: ubuntu-latest
- target: linux-riscv64
container: ubuntu:22.04
- target: win64
os: ubuntu-latest
- target: linux-x86_64
container: ubuntu:22.04
os: ubuntu-latest
- target: wasm
container: ubuntu:22.04
os: ubuntu-latest
- target: win32
container: ubuntu:22.04
os: ubuntu-latest
- target: win64
container: ubuntu:22.04
os: ubuntu-latest
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.container }}
Expand All @@ -54,25 +88,22 @@ jobs:
with:
path: |
~/PawPawBuilds
key: common-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
key: common-${{ matrix.container || matrix.os }}-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
- name: Set up dependencies
run: |
./.github/workflows/bootstrap-deps.sh ${{ matrix.target }}
- name: Run bootstrap
shell: bash
run: |
if [ '${{ matrix.target }}' == 'wasm' ]; then
source ~/PawPawBuilds/emsdk/emsdk_env.sh
fi
./bootstrap-common.sh ${{ matrix.target }} && ./.cleanup.sh ${{ matrix.target }}
- name: Pack bootstrap build
shell: bash
run: |
tar -C ~/PawPawBuilds -czf common-${{ matrix.target }}.tar.gz builds targets
tar -C ~/PawPawBuilds -czf common-${{ env.PAWPAW_PACK_NAME }}.tar.gz builds targets
- uses: actions/upload-artifact@v3
with:
name: common-${{ matrix.target }}
path: common-${{ matrix.target }}.tar.gz
name: common-${{ env.PAWPAW_PACK_NAME }}
path: common-${{ env.PAWPAW_PACK_NAME }}.tar.gz

#plugins:
#strategy:
Expand Down
14 changes: 14 additions & 0 deletions setup/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ if [ -n "${PAWPAW_NOSIMD}" ] && [ "${PAWPAW_NOSIMD}" -ne 0 ]; then
PAWPAW_PREFIX+="-nosimd"
fi

# ---------------------------------------------------------------------------------------------------------------------
# emscripten setup

if [ "${WASM}" -eq 1 ]; then
EMSCRIPTEN_VERSION=${EMSCRIPTEN_VERSION:=3.1.27}

if [ ! -e "${PAWPAW_DIR}/emsdk" ]; then
git clone https://github.com/emscripten-core/emsdk.git "${PAWPAW_DIR}/emsdk"
"${PAWPAW_DIR}/emsdk/emsdk" install ${EMSCRIPTEN_VERSION} && "${PAWPAW_DIR}/emsdk/emsdk" activate ${EMSCRIPTEN_VERSION}
fi

source "${PAWPAW_DIR}/emsdk/emsdk_env.sh"
fi

# ---------------------------------------------------------------------------------------------------------------------
# build environment

Expand Down

0 comments on commit 3f5164a

Please sign in to comment.