fix zig #179
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: linux-precompile-gnu | |
on: | |
push: | |
tags: | |
- 'v*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
mix_compile: | |
runs-on: ubuntu-20.04 | |
env: | |
OPENCV_VER: "4.10.0" | |
MIX_ENV: prod | |
ELIXIR_VERSION: "1.16.1" | |
EVISION_PREFER_PRECOMPILED: "false" | |
EVISION_GENERATE_LANG: "erlang,elixir" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
arch: x86_64-linux-gnu | |
cmake_toolchain_file: "" | |
c_compiler: gcc | |
cpp_compiler: g++ | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: i686-linux-gnu | |
cmake_toolchain_file: cc_toolchain/i686-linux-gnu.cmake | |
c_compiler: gcc-i686-linux-gnu | |
cpp_compiler: g++-i686-linux-gnu | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: aarch64-linux-gnu | |
cmake_toolchain_file: cc_toolchain/aarch64-linux-gnu.cmake | |
c_compiler: gcc-aarch64-linux-gnu | |
cpp_compiler: g++-aarch64-linux-gnu | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: armv7l-linux-gnueabihf | |
cmake_toolchain_file: cc_toolchain/armv7l-linux-gnueabihf.cmake | |
c_compiler: gcc-arm-linux-gnueabihf | |
cpp_compiler: g++-arm-linux-gnueabihf | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: armv6-linux-gnueabihf | |
cmake_toolchain_file: cc_toolchain/armv6-nerves-linux-gnueabihf.cmake | |
c_compiler: armv6-nerves-linux-gnueabihf-gcc | |
cpp_compiler: armv6-nerves-linux-gnueabihf-g++ | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: ppc64le-linux-gnu | |
cmake_toolchain_file: cc_toolchain/ppc64le-linux-gnu.cmake | |
c_compiler: gcc-powerpc64le-linux-gnu | |
cpp_compiler: g++-powerpc64le-linux-gnu | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: s390x-linux-gnu | |
cmake_toolchain_file: cc_toolchain/s390x-linux-gnu.cmake | |
c_compiler: gcc-s390x-linux-gnu | |
cpp_compiler: g++-s390x-linux-gnu | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
- pair: | |
arch: riscv64-linux-gnu | |
cmake_toolchain_file: cc_toolchain/riscv64-linux-gnu.cmake | |
c_compiler: gcc-riscv64-linux-gnu | |
cpp_compiler: g++-riscv64-linux-gnu | |
OTP_VERSION: "25" | |
NIF_VERSION: "2.16" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.pair.OTP_VERSION }} | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update -q | |
sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip curl git gzip python3 ca-certificates libncurses5-dev libssl-dev libeigen3-dev | |
if [ "${{ matrix.pair.arch }}" = "armv6-linux-gnueabihf" ]; then | |
curl -fSL https://github.com/nerves-project/toolchains/releases/download/v13.2.0/nerves_toolchain_armv6_nerves_linux_gnueabihf-linux_x86_64-13.2.0-363664F.tar.xz -o nerves_toolchain_armv6_nerves_linux_gnueabihf-linux_x86_64-13.2.0-363664F.tar.xz | |
tar -xf nerves_toolchain_armv6_nerves_linux_gnueabihf-linux_x86_64-13.2.0-363664F.tar.xz | |
sudo mv nerves_toolchain_armv6_nerves_linux_gnueabihf-linux_x86_64-13.2.0 /usr/local/bin/nerves_toolchain_armv6_nerves_linux_gnueabihf-linux_x86_64-13.2.0 | |
else | |
sudo apt-get install -y ${{ matrix.pair.c_compiler }} ${{ matrix.pair.cpp_compiler }} | |
fi | |
- name: Cache mix packages | |
id: cache-mix-deps | |
uses: actions/cache@v4 | |
with: | |
key: deps-${{ hashFiles('mix.lock') }}-${{ matrix.pair.OTP_VERSION }}-${{ env.ELIXIR_VERSION }} | |
path: | | |
./deps | |
- name: Get mix deps | |
if: steps.cache-mix-deps.outputs.cache-hit != 'true' | |
run: | | |
mix deps.get | |
- name: Cache OpenCV source code | |
id: cache-opencv | |
uses: actions/cache@v4 | |
with: | |
key: opencv-with-contrib-${{ env.OPENCV_VER }} | |
path: | | |
./3rd_party | |
- name: Download OpenCV source code | |
if: steps.cache-opencv.outputs.cache-hit != 'true' | |
run: | | |
bash scripts/download_opencv.sh ${OPENCV_VER} 3rd_party/cache 3rd_party/opencv/ | |
bash scripts/download_opencv_contrib.sh ${OPENCV_VER} 3rd_party/cache 3rd_party/opencv/ | |
- name: Compile OpenCV (without contrib modules) | |
run: | | |
export EVISION_ENABLE_CONTRIB=false | |
if [ "${{ matrix.pair.cmake_toolchain_file }}" != "" ]; then | |
export CMAKE_TOOLCHAIN_FILE="$(pwd)/${{ matrix.pair.cmake_toolchain_file }}" | |
fi | |
if [ "${{ matrix.pair.arch }}" = "armv6-linux-gnueabihf" ]; then | |
export TARGET_GCC_FLAGS="-mabi=aapcs-linux -mfpu=vfp -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=arm1176jzf-s -fPIE -pie -Wl,-z,now -Wl,-z,relro" | |
fi | |
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" | |
rm -rf "./_build/${{ env.MIX_ENV }}/lib/evision" | |
mix compile_opencv | |
- name: Mix compile (without contrib modules) | |
run: | | |
export EVISION_ENABLE_CONTRIB=false | |
if [ "${{ matrix.pair.cmake_toolchain_file }}" != "" ]; then | |
export CMAKE_TOOLCHAIN_FILE="$(pwd)/${{ matrix.pair.cmake_toolchain_file }}" | |
fi | |
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" | |
rm -f _build/${MIX_ENV}/lib/evision/priv/evision.so | |
rm -rf lib/generated && rm -rf src/generated | |
mkdir -p lib/generated && mkdir -p src/generated | |
mix compile | |
- name: Create precompiled library (without contrib modules) | |
run: | | |
export PKG_NAME=evision-nif_${{ matrix.pair.NIF_VERSION }}-${{ matrix.pair.arch }}-${GITHUB_REF##*/v} | |
mkdir -p "${PKG_NAME}" | |
export PRIV_DIR="$(pwd)/_build/${MIX_ENV}/lib/evision/priv" | |
mv "${PRIV_DIR}/include" /tmp/include | |
cp -a "${PRIV_DIR}" "${PKG_NAME}" | |
cp -a lib/generated "${PKG_NAME}/elixir_generated" | |
cp -a src/generated "${PKG_NAME}/erlang_generated" | |
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}" | |
rm -rf "${PKG_NAME}" | |
ls -lah "${PKG_NAME}.tar.gz" | |
mkdir -p artifacts | |
mv "${PKG_NAME}.tar.gz" artifacts | |
cd artifacts | |
sha256sum "${PKG_NAME}.tar.gz" | tee "${PKG_NAME}.tar.gz.sha256" | |
mv /tmp/include "${PRIV_DIR}/include" | |
- name: Mix compile (without contrib modules) for Gleam (experimental) | |
run: | | |
export EVISION_ENABLE_CONTRIB=false | |
export GLEAM_EVISION=true | |
if [ "${{ matrix.pair.cmake_toolchain_file }}" != "" ]; then | |
export CMAKE_TOOLCHAIN_FILE="$(pwd)/${{ matrix.pair.cmake_toolchain_file }}" | |
fi | |
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" | |
rm -f _build/${MIX_ENV}/lib/evision/priv/evision.so | |
rm -rf lib/generated && rm -rf src/generated | |
mix compile | |
unset GLEAM_EVISION | |
- name: Create precompiled library (without contrib modules) for Gleam (experimental) | |
run: | | |
export PKG_NAME=gleam_evision-nif_${{ matrix.pair.NIF_VERSION }}-${{ matrix.pair.arch }}-${GITHUB_REF##*/v} | |
mkdir -p "${PKG_NAME}" | |
export PRIV_DIR="$(pwd)/_build/${MIX_ENV}/lib/evision/priv" | |
mv "${PRIV_DIR}/include" /tmp/include | |
cp -a "${PRIV_DIR}" "${PKG_NAME}" | |
cp -a gleam_src "${PKG_NAME}/gleam_generated" | |
cp -a src/evision_highgui.erl "${PKG_NAME}/gleam_generated/" | |
cp -a src/evision_internal_structurise.erl "${PKG_NAME}/gleam_generated/" | |
cp -a src/evision_windows_fix.erl "${PKG_NAME}/gleam_generated/" | |
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}" | |
rm -rf "${PKG_NAME}" | |
ls -lah "${PKG_NAME}.tar.gz" | |
mkdir -p artifacts | |
mv "${PKG_NAME}.tar.gz" artifacts | |
cd artifacts | |
sha256sum "${PKG_NAME}.tar.gz" | tee "${PKG_NAME}.tar.gz.sha256" | |
mv /tmp/include "${PRIV_DIR}/include" | |
- name: Compile OpenCV (with contrib modules) | |
run: | | |
export EVISION_ENABLE_CONTRIB=true | |
if [ "${{ matrix.pair.cmake_toolchain_file }}" != "" ]; then | |
export CMAKE_TOOLCHAIN_FILE="$(pwd)/${{ matrix.pair.cmake_toolchain_file }}" | |
fi | |
if [ "${{ matrix.pair.arch }}" = "armv6-linux-gnueabihf" ]; then | |
export TARGET_GCC_FLAGS="-mabi=aapcs-linux -mfpu=vfp -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=arm1176jzf-s -fPIE -pie -Wl,-z,now -Wl,-z,relro" | |
fi | |
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" | |
rm -rf "./_build/${{ env.MIX_ENV }}/lib/evision" | |
mix compile_opencv | |
- name: Mix compile (with contrib modules) | |
run: | | |
export EVISION_ENABLE_CONTRIB=true | |
if [ "${{ matrix.pair.cmake_toolchain_file }}" != "" ]; then | |
export CMAKE_TOOLCHAIN_FILE="$(pwd)/${{ matrix.pair.cmake_toolchain_file }}" | |
fi | |
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" | |
rm -f _build/${MIX_ENV}/lib/evision/priv/evision.so | |
rm -rf lib/generated && rm -rf src/generated | |
mkdir -p lib/generated && mkdir -p src/generated | |
mix compile | |
- name: Create precompiled library (with contrib modules) | |
run: | | |
export PKG_NAME=evision-nif_${{ matrix.pair.NIF_VERSION }}-${{ matrix.pair.arch }}-contrib-${GITHUB_REF##*/v} | |
mkdir -p "${PKG_NAME}" | |
export PRIV_DIR="$(pwd)/_build/${MIX_ENV}/lib/evision/priv" | |
mv "${PRIV_DIR}/include" /tmp/include | |
cp -a "${PRIV_DIR}" "${PKG_NAME}" | |
cp -a lib/generated "${PKG_NAME}/elixir_generated" | |
cp -a src/generated "${PKG_NAME}/erlang_generated" | |
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}" | |
rm -rf "${PKG_NAME}" | |
ls -lah "${PKG_NAME}.tar.gz" | |
mkdir -p artifacts | |
mv "${PKG_NAME}.tar.gz" artifacts | |
cd artifacts | |
sha256sum "${PKG_NAME}.tar.gz" | tee "${PKG_NAME}.tar.gz.sha256" | |
mv /tmp/include "${PRIV_DIR}/include" | |
- name: Mix compile (with contrib modules) for Gleam (experimental) | |
run: | | |
export EVISION_ENABLE_CONTRIB=true | |
export GLEAM_EVISION=true | |
if [ "${{ matrix.pair.cmake_toolchain_file }}" != "" ]; then | |
export CMAKE_TOOLCHAIN_FILE="$(pwd)/${{ matrix.pair.cmake_toolchain_file }}" | |
fi | |
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" | |
rm -f _build/${MIX_ENV}/lib/evision/priv/evision.so | |
rm -rf lib/generated && rm -rf src/generated | |
mix compile | |
- name: Create precompiled library (with contrib modules) | |
run: | | |
export PKG_NAME=gleam_evision-nif_${{ matrix.pair.NIF_VERSION }}-${{ matrix.pair.arch }}-contrib-${GITHUB_REF##*/v} | |
mkdir -p "${PKG_NAME}" | |
export PRIV_DIR="$(pwd)/_build/${MIX_ENV}/lib/evision/priv" | |
mv "${PRIV_DIR}/include" /tmp/include | |
cp -a "${PRIV_DIR}" "${PKG_NAME}" | |
cp -a gleam_src "${PKG_NAME}/gleam_generated" | |
cp -a src/evision_highgui.erl "${PKG_NAME}/gleam_generated/" | |
cp -a src/evision_internal_structurise.erl "${PKG_NAME}/gleam_generated/" | |
cp -a src/evision_windows_fix.erl "${PKG_NAME}/gleam_generated/" | |
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}" | |
rm -rf "${PKG_NAME}" | |
ls -lah "${PKG_NAME}.tar.gz" | |
mkdir -p artifacts | |
mv "${PKG_NAME}.tar.gz" artifacts | |
cd artifacts | |
sha256sum "${PKG_NAME}.tar.gz" | tee "${PKG_NAME}.tar.gz.sha256" | |
mv /tmp/include "${PRIV_DIR}/include" | |
- uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
artifacts/*.tar.gz | |
artifacts/*.sha256 |