update to OpenCV 4.8.0 #655
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: nerves-build | |
on: | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
- '**/*.md' | |
- 'LICENSE*' | |
- 'examples/**' | |
- 'test/**' | |
- 'Makefile.win' | |
- 'cc_toolchain/**' | |
- 'checksum.exs' | |
- '.github/FUNDING.yml' | |
- '.github/workflows/linux-*' | |
- '.github/workflows/macos-*' | |
- '.github/workflows/windows-*' | |
- '.github/workflows/test-*.yml' | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- main | |
- nerves-* | |
paths-ignore: | |
- '*.md' | |
- '**/*.md' | |
- 'LICENSE*' | |
- 'examples/**' | |
- 'Makefile.win' | |
- 'cc_toolchain/**' | |
- 'checksum.exs' | |
- '.github/FUNDING.yml' | |
- '.github/workflows/linux-*' | |
- '.github/workflows/macos-*' | |
- '.github/workflows/windows-*' | |
- '.github/workflows/test-*.yml' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
mix_compile: | |
runs-on: ubuntu-20.04 | |
env: | |
MIX_ENV: prod | |
NERVES_PROJ_NAME: nerves_evision | |
OPENCV_VER: "4.8.0" | |
NERVES_LIVEBOOK_VER: "v0.10.1" | |
ELIXIR_VERSION: "1.15.4" | |
EVISION_PREFER_PRECOMPILED: "false" | |
strategy: | |
matrix: | |
include: | |
- pair: | |
target: rpi4 | |
otp_version: "26" | |
- pair: | |
target: rpi3a | |
otp_version: "26" | |
- pair: | |
target: rpi3 | |
otp_version: "26" | |
- pair: | |
target: rpi2 | |
otp_version: "26" | |
- pair: | |
target: rpi0 | |
otp_version: "26" | |
- pair: | |
target: rpi | |
otp_version: "26" | |
- pair: | |
target: bbb | |
otp_version: "26" | |
- pair: | |
target: osd32mp1 | |
otp_version: "26" | |
- pair: | |
target: npi_imx6ull | |
otp_version: "26" | |
- pair: | |
target: mangopi_mq_pro | |
otp_version: "26" | |
- pair: | |
target: grisp2 | |
otp_version: "26" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.pair.otp_version }} | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
- name: Install nerves and system dependencies | |
run: | | |
mkdir -p ~/.ssh | |
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCulZpVE/JdpWX53C35n45RSIMtaIIiTMnmRo5oDEMbyh0NnKI5byikkOvGnGLOO2KTlq4We+MF5iKx72B1Ixl8RY7L6Kc/h3R6jG4uOWBhw/WBhIebteJVYDzrlU8fHTewquWYT6tJ7v7g54Qe5vofsDeKBDqTJqJPlwNSxP8AjPZ0vQ4O4IhG0CXaDzU/G50sqzquKckgGWURLN9LcsA+kzciKJRhKw4Q7kpOiTNG/fzYxBpgpNrnyyr7bhj0jdOsg9KoG57aLSqbmEVCOyWa6yh6lOTp37S6ijBfQORxUu3I+6B04zUBSEvN4wgqslHU9pbIio8Szz1vbnlqsgO0tG1yqALfs6RVSjW81AujKefeH/8seE7q0yiHJXkE4tejIcewJT+2e6p/fP2pVSwyRqZ1bObtRUCMG3Pwdi0IpfsyBSa02Qc7eT9VB1WN7XD1vpfMDQ/nIWmoA40VkX3F3v5Mht5PZwVmlRyM8BrLtCYTreUP5xl6ZZCSX2IfOI8= nerves-ci-build' > ~/.ssh/id_rsa.pub | |
sudo apt-get update && sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip curl git libssl-dev libncurses5-dev python3 ca-certificates squashfs-tools ssh-askpass libmnl-dev | |
mix local.hex --force | |
mix local.rebar --force | |
- name: Cache mix packages | |
id: cache-mix-deps | |
uses: actions/cache@v3 | |
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 | |
id: cache-opencv | |
uses: actions/cache@v3 | |
with: | |
key: opencv-${{ 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/ | |
- name: Make a nerves project | |
run: | | |
mix archive.install hex nerves_bootstrap --force || true | |
wget -k https://github.com/fwup-home/fwup/releases/download/v1.9.1/fwup_1.9.1_amd64.deb -O ./fwup_1.9.1_amd64.deb | |
sudo dpkg -i ./fwup_1.9.1_amd64.deb | |
cd ../ | |
git clone https://github.com/livebook-dev/nerves_livebook.git | |
cd nerves_livebook | |
git checkout "${NERVES_LIVEBOOK_VER}" | |
git checkout mix.exs | |
LINE="$(grep -n 'toolshed' mix.exs | awk -F: '{print $1+1}')" | |
head -n "${LINE}" mix.exs > mix.exs.tmp | |
echo ' {:evision, path: "../evision"},' >> mix.exs.tmp | |
tail -n "+${LINE}" mix.exs >> mix.exs.tmp | |
mv mix.exs.tmp mix.exs | |
sed -i 's/nx, "~> 0.3.0/nx, "~> 0.4/g' mix.exs | |
cat mix.exs | |
export MIX_TARGET=${{ matrix.pair.target }} | |
mix deps.get | |
mix deps.update nx | |
mix deps.update kino | |
cp -a ../evision/examples ./priv/evision_examples | |
sed -i 's/"welcome.livemd"\,/"welcome.livemd"\, "evision_examples",/g' lib/nerves_livebook/application.ex | |
export MAKE_BUILD_FLAGS="-j$(nproc)" | |
mix deps.compile | |
mix firmware | |
mkdir -p "/tmp/firmware" | |
cp "./_build/${MIX_TARGET}_${MIX_ENV}/nerves/images/nerves_livebook.fw" "/tmp/firmware/${NERVES_PROJ_NAME}_${{ matrix.pair.target }}_${MIX_ENV}.fw" | |
- name: Upload build artifacts | |
uses: actions/[email protected] | |
with: | |
name: ${{ env.NERVES_PROJ_NAME }}_${{ matrix.pair.target }}_${{ env.MIX_ENV }}.fw | |
path: /tmp/firmware/${{ env.NERVES_PROJ_NAME }}_${{ matrix.pair.target }}_${{ env.MIX_ENV }}.fw | |
- uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: /tmp/firmware/${{ env.NERVES_PROJ_NAME }}_${{ matrix.pair.target }}_${{ env.MIX_ENV }}.fw |