Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross-platform builder in github action #132

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/dockcross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Dockcross

on:
push:
branches:
- "*"
paths-ignore:
- "**/README.md"
pull_request:
branches:
- "*"

jobs:
image:
name: "Build ${{ matrix.image_name }} ${{ matrix.build_type }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Remove images that you do not need
image_name:
[
android-arm,
android-arm64,
android-x86,
android-x86_64,
linux-x86,
linux-x64,
linux-x64-clang,
linux-arm64,
linux-arm64-musl,
linux-arm64-full,
linux-armv5,
linux-armv5-musl,
linux-m68k-uclibc,
linux-s390x,
linux-x64-tinycc,
linux-armv6,
linux-armv6-lts,
linux-armv6-musl,
linux-armv7l-musl,
linux-armv7,
linux-armv7a,
linux-x86_64-full,
linux-mips,
linux-ppc64le,
linux-riscv64,
linux-riscv32,
linux-xtensa-uclibc,
windows-static-x86,
windows-static-x64,
windows-static-x64-posix,
windows-armv7,
windows-shared-x86,
windows-shared-x64,
windows-shared-x64-posix,
windows-arm64,
manylinux2014-x64,
manylinux2014-x86,
manylinux2014-aarch64,
web-wasm,
]
# Disable MinSizeRel RelWithDebInfo Debug Release
build_type: [Debug]
steps:
- name: "Checkout Code"
uses: actions/checkout@v2
with:
submodules: "recursive"
fetch-depth: 0
- name: "build"
run: ./tools/dockcross-cmake-builder.sh ${{ matrix.image_name }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
24 changes: 24 additions & 0 deletions tools/dockcross-cmake-builder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

if (( $# >= 1 )); then
image=$1
build_file=build-${image%:*}
shift 1

cmake_arg=$@
echo "cmake arg: $cmake_arg"

#echo "Pulling dockcross/$image"
#docker pull dockcross/"$image"

echo "Make script dockcross-$image"
docker run --rm dockcross/"$image" > ./dockcross-"$image"
chmod +x ./dockcross-"$image"

echo "Build $build_file"
./dockcross-"$image" cmake -B "$build_file" -S . -G Ninja $cmake_arg
./dockcross-"$image" ninja -C "$build_file"
else
echo "Usage: ${0##*/} <docker imag (ex: linux-x64/linux-x64-clang/linux-arm64/windows-shared-x64/windows-static-x64...)> <cmake arg.>"
exit 1
fi