Skip to content

v0.2.10

v0.2.10 #884

Workflow file for this run

name: linux-x86_64
on:
pull_request:
paths-ignore:
- 'assets/**'
- '*.md'
- '**/*.md'
- 'LICENSE*'
- 'examples/**'
- 'nerves/**'
- 'gleam_src/**'
- 'Makefile.win'
- 'cc_toolchain/**'
- 'c_src/windows_fix/windows_fix.cpp'
- 'checksum.exs'
- 'do_release.sh'
- '.github/FUNDING.yml'
- '.github/workflows/nerves-*'
- '.github/workflows/macos-*'
- '.github/workflows/windows-*'
- '.github/workflows/test-*.yml'
- '.github/workflows/linux-arm64.yml'
- '.github/workflows/linux-armv7.yml'
- '.github/workflows/linux-ppc64le.yml'
- '.github/workflows/linux-s390x.yml'
- '.github/workflows/linux-cuda-*.yml'
- '.github/workflows/linux-precompile-*.yml'
- '.github/*manylinux*.sh'
push:
branches:
- main
- feature-*
- experimental-*
- test-*
- fix-*
paths-ignore:
- '*.md'
- '**/*.md'
- 'LICENSE*'
- 'examples/**'
- 'nerves/**'
- 'Makefile.win'
- 'cc_toolchain/**'
- 'c_src/windows_fix/windows_fix.cpp'
- 'checksum.exs'
- '.github/FUNDING.yml'
- '.github/workflows/nerves-*'
- '.github/workflows/macos-*'
- '.github/workflows/windows-*'
- '.github/workflows/test-*.yml'
- '.github/workflows/linux-arm64.yml'
- '.github/workflows/linux-armv7.yml'
- '.github/workflows/linux-ppc64le.yml'
- '.github/workflows/linux-s390x.yml'
- '.github/workflows/linux-cuda-*.yml'
- '.github/workflows/linux-precompile-*.yml'
- '.github/*manylinux*.sh'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
musl:
runs-on: ubuntu-20.04
container: alpine:latest
env:
MIX_ENV: test
OPENCV_VER: "4.10.0"
OTP_VERSION: "26.2.2"
ELIXIR_VERSION: "1.16.1"
EVISION_PREFER_PRECOMPILED: "false"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: |
apk add cmake make python3 bash curl unzip gcc g++ ncurses-dev openssl-dev linux-headers perl git dpkg ca-certificates
curl -fSL https://github.com/cocoa-xu/otp-build/releases/download/v${{ env.OTP_VERSION }}/otp-x86_64-linux-musl.tar.gz -o /tmp/otp-v${{ env.OTP_VERSION }}-x86_64-linux-musl.tar.gz
tar -xzf /tmp/otp-v${{ env.OTP_VERSION }}-x86_64-linux-musl.tar.gz -C /usr/local --strip-components=3
- name: Install elixir
run: |
mkdir -p "${HOME}/.elixir"
cd "${HOME}/.elixir"
curl -fSL https://github.com/elixir-lang/elixir/archive/refs/tags/v${ELIXIR_VERSION}.tar.gz -o v${ELIXIR_VERSION}.tar.gz
tar xf "v${ELIXIR_VERSION}.tar.gz"
rm -f "v${ELIXIR_VERSION}.tar.gz"
cd "elixir-${ELIXIR_VERSION}"
make clean
make install
export PATH="${PATH}:${HOME}/.elixir/elixir-${ELIXIR_VERSION}/bin"
mix local.hex --force
mix local.rebar --force
- name: Cache mix packages
id: cache-mix-deps
uses: actions/cache@v4
with:
key: deps-${{ hashFiles('mix.lock') }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}
path: |
./deps
- name: Get mix deps
if: steps.cache-mix-deps.outputs.cache-hit != 'true'
run: |
export PATH="${PATH}:${HOME}/.elixir/elixir-${ELIXIR_VERSION}/bin"
mix deps.get
- name: Cache OpenCV
id: cache-opencv
uses: actions/cache@v4
with:
key: opencv-with-contrib-${{ env.OPENCV_VER }}
path: |
./3rd_party
- name: Download OpenCV
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: Cache compiled OpenCV
id: cache-mix-compile_opencv
uses: actions/cache@v4
with:
key: compile-opencv-v${{ env.OPENCV_VER }}-x86_64-linux-musl-${{ hashFiles('Makefile') }}
path: |
./_build/${{ env.MIX_ENV }}/lib/evision
./c_src/headers.txt
./c_src/configuration.private.hpp
- name: Compile OpenCV
if: steps.cache-mix-compile_opencv.outputs.cache-hit != 'true'
run: |
export PATH="${PATH}:${HOME}/.elixir/elixir-${ELIXIR_VERSION}/bin"
mix compile_opencv
- name: Mix Compile
run: |
export PATH="${PATH}:${HOME}/.elixir/elixir-${ELIXIR_VERSION}/bin"
rm -f _build/${{ env.MIX_ENV }}/lib/evision/priv/evision.so
ls -la ./c_src
mix compile
ls -la ./lib/generated
- name: Cache testdata
id: cache-mix-testdata
uses: actions/cache@v4
with:
key: testdata-${{ hashFiles('test/downloading_list.txt') }}
path: |
./test/testdata
- name: Mix Test
run: |
mix test --include require_downloading
gnu:
runs-on: ubuntu-20.04
env:
MIX_ENV: test
OPENCV_VER: "4.10.0"
OTP_VERSION: "25.2"
ELIXIR_VERSION: "1.14.3"
EVISION_PREFER_PRECOMPILED: "false"
PKG_CONFIG_PATH: "/usr/lib/x86_64-linux-gnu/pkgconfig"
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip curl git libssl-dev gzip python3 ca-certificates \
libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev ffmpeg libeigen3-dev
- name: Cache mix packages
id: cache-mix-deps
uses: actions/cache@v4
with:
key: deps-${{ hashFiles('mix.lock') }}-${{ env.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
id: cache-opencv
uses: actions/cache@v4
with:
key: opencv-with-contrib-${{ env.OPENCV_VER }}
path: |
./3rd_party
- name: Download OpenCV
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: Cache compiled OpenCV
id: cache-mix-compile_opencv
uses: actions/cache@v4
with:
key: compiled-opencv-${{ env.OPENCV_VER }}-x86_64-linux-gnu-${{ hashFiles('Makefile') }}-${{ hashFiles('py_src/*.py') }}
path: |
./_build/${{ env.MIX_ENV }}/lib/evision
./c_src/headers.txt
./c_src/configuration.private.hpp
- name: Compile OpenCV only
if: steps.cache-mix-compile_opencv.outputs.cache-hit != 'true'
run: |
mix compile_opencv
- name: Mix Compile
run: |
rm -f _build/test/lib/evision/priv/evision.so
rm -rf lib/generated && rm -rf src/generated
mkdir -p lib/generated && mkdir -p src/generated
mix compile
- name: Compile once again but without optional deps
run: mix compile --force --warnings-as-errors --no-optional-deps
- name: Cache testdata
id: cache-mix-testdata
uses: actions/cache@v4
with:
key: testdata-${{ hashFiles('test/downloading_list.txt') }}
path: |
./test/testdata
- name: Mix Test
run: |
mix test --include require_downloading --include require_ffmpeg