[ci-nerves] updated ci #23
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' | |
- '**/*.livemd' | |
- 'LICENSE*' | |
- 'test/**' | |
- 'Makefile.win' | |
- 'cc_toolchain/**' | |
- '.github/FUNDING.yml' | |
- '.github/workflows/linux-*' | |
- '.github/workflows/macos-*' | |
- '.github/workflows/windows-*' | |
- '.github/workflows/test-*' | |
push: | |
tags: | |
- 'v*' | |
- 'nerves-release-*' | |
branches: | |
- main | |
- nerves-* | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.livemd' | |
- 'LICENSE*' | |
- 'Makefile.win' | |
- 'cc_toolchain/**' | |
- '.github/FUNDING.yml' | |
- '.github/workflows/linux-*' | |
- '.github/workflows/macos-*' | |
- '.github/workflows/windows-*' | |
- '.github/workflows/test-*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
mix-firmware: | |
runs-on: ubuntu-20.04 | |
env: | |
MIX_ENV: prod | |
NERVES_PROJ_NAME: nerves_tflite | |
NERVES_LIVEBOOK_VER: "v0.12.1" | |
TFLITE_BEAM_PREFER_PRECOMPILED: "true" | |
TFLITE_BEAM_CORAL_SUPPORT: "true" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
target: rpi3 | |
libedgetpu_library: armv7l | |
- pair: | |
target: rpi3a | |
libedgetpu_library: armv7l | |
- pair: | |
target: rpi2 | |
libedgetpu_library: armv7l | |
- pair: | |
target: rpi0 | |
libedgetpu_library: armv6 | |
- pair: | |
target: rpi | |
libedgetpu_library: armv6 | |
- pair: | |
target: bbb | |
libedgetpu_library: armv7l | |
- pair: | |
target: osd32mp1 | |
libedgetpu_library: armv7l | |
- pair: | |
target: npi_imx6ull | |
libedgetpu_library: armv7l | |
- pair: | |
target: grisp2 | |
libedgetpu_library: armv7l | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "26" | |
elixir-version: "1.16" | |
- name: Install nerves and system dependecies | |
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 | |
mix archive.install hex nerves_bootstrap --force | |
wget -k https://github.com/fwup-home/fwup/releases/download/v1.10.0/fwup_1.10.0_amd64.deb -O fwup_1.10.0_amd64.deb | |
sudo dpkg -i fwup_1.10.0_amd64.deb | |
- name: Make a nerves project | |
run: | | |
cd ../ | |
git clone https://github.com/livebook-dev/nerves_livebook.git | |
cd nerves_livebook | |
git checkout "${NERVES_LIVEBOOK_VER}" | |
LINE="$(grep -n 'tflite_elixir' mix.exs | awk -F: '{print $1+1}')" | |
head -n "$(($LINE-2))" mix.exs > mix.exs.tmp | |
echo ' {:tflite_elixir, "~> 0.3", path: "../tflite_elixir"},' >> mix.exs.tmp | |
tail -n "+${LINE}" mix.exs >> mix.exs.tmp | |
mv mix.exs.tmp mix.exs | |
cat mix.exs | |
export MIX_TARGET=${{ matrix.pair.target }} | |
export TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES=${{ matrix.pair.libedgetpu_library }} | |
export TFLITE_BEAM_PREFER_PRECOMPILED=true | |
if [ "${TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES}" = "armv6" ]; then | |
export TFLITE_BEAM_PREFER_PRECOMPILED=false | |
fi | |
mix deps.get 1>/dev/null 2>&1 | |
cp -a ../tflite_elixir/notebooks ./priv/tflite_examples | |
sed -i 's/"welcome.livemd"\,/"welcome.livemd"\, "tflite_examples",/g' lib/nerves_livebook/application.ex | |
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/upload-artifact@v3 | |
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 | |
mix-firmware-aarch64: | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: prod | |
NERVES_PROJ_NAME: nerves_tflite | |
NERVES_LIVEBOOK_VER: "v0.12.1" | |
TFLITE_BEAM_PREFER_PRECOMPILED: "false" | |
TFLITE_BEAM_CORAL_SUPPORT: "true" | |
TFBEAM_XNNPACK_ENABLE_ARM_I8MM: "ON" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
target: rpi5 | |
libedgetpu_library: aarch64 | |
- pair: | |
target: rpi4 | |
libedgetpu_library: aarch64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "26" | |
elixir-version: "1.16" | |
- name: Install nerves and system dependecies | |
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 | |
mix archive.install hex nerves_bootstrap --force | |
wget -k https://github.com/fwup-home/fwup/releases/download/v1.10.0/fwup_1.10.0_amd64.deb -O fwup_1.10.0_amd64.deb | |
sudo dpkg -i fwup_1.10.0_amd64.deb | |
- name: Make a nerves project | |
run: | | |
cd ../ | |
git clone https://github.com/livebook-dev/nerves_livebook.git | |
cd nerves_livebook | |
git checkout "${NERVES_LIVEBOOK_VER}" | |
LINE="$(grep -n 'tflite_elixir' mix.exs | awk -F: '{print $1+1}')" | |
head -n "$(($LINE-2))" mix.exs > mix.exs.tmp | |
echo ' {:tflite_elixir, "~> 0.3", path: "../tflite_elixir"},' >> mix.exs.tmp | |
tail -n "+${LINE}" mix.exs >> mix.exs.tmp | |
mv mix.exs.tmp mix.exs | |
cat mix.exs | |
export MIX_TARGET=${{ matrix.pair.target }} | |
export TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES=${{ matrix.pair.libedgetpu_library }} | |
mix deps.get 1>/dev/null 2>&1 | |
cp -a ../tflite_elixir/notebooks ./priv/tflite_examples | |
sed -i 's/"welcome.livemd"\,/"welcome.livemd"\, "tflite_examples",/g' lib/nerves_livebook/application.ex | |
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/upload-artifact@v3 | |
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 |