Skip to content

Add all esp adf decoders #72

Add all esp adf decoders

Add all esp adf decoders #72

Workflow file for this run

# SPDX-License-Identifier: MIT
name: Build
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
soc: ["esp32", "esp32c3", "esp32s2", "esp32s3", "esp32c6"]
idf-version:
- 'v5.1.3'
- 'v5.2.1'
additional_opts: ""

Check failure on line 19 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 19, Col: 26): Unexpected value ''
include:
- additional_opts: "FLAC_DECODER OGG_DECODER"
soc: "esp32c3"
idf-version: "v5.2.1"
- additional_opts: "G711_DECODER OPUS_DECODER"
soc: "esp32c3"
idf-version: "v5.2.1"
- additional_opts: "AMR_DECODER"
soc: "esp32c3"
idf-version: "v5.2.1"
- additional_opts: "PCM_DECODER WAV_DECODER"
soc: "esp32c3"
idf-version: "v5.2.1"
container: espressif/idf:${{ matrix.idf-version }}
steps:
- name: Checkout AtomVM
uses: actions/checkout@v4
with:
repository: atomvm/AtomVM
path: AtomVM
- name: Checkout atomvm_esp_adf
uses: actions/checkout@v4
with:
path: AtomVM/src/platforms/esp32/components/atomvm_esp_adf/
- name: Checkout atomvm_esp_adf submodules
shell: bash
working-directory: AtomVM/src/platforms/esp32/components/atomvm_esp_adf/
run: |
git submodule update --init components/esp-adf
cd components/esp-adf
git submodule update --init components/esp-adf-libs/
- name: Install dependencies to build host AtomVM
run: |
set -eu
apt update
DEBIAN_FRONTEND=noninteractive apt install -y -q \
doxygen erlang-base erlang-dialyzer elixir \
gcc g++ zlib1g-dev libmbedtls-dev make cmake
- name: Build AtomVM libraries
shell: bash
working-directory: AtomVM/
run: |
mkdir build
cd build
cmake ..
cd libs
make
- name: Build ${{ matrix.soc }} binary with idf.py
shell: bash
working-directory: AtomVM/src/platforms/esp32/
run: |
cp sdkconfig.release-defaults sdkconfig.defaults
rm -rf build
. $IDF_PATH/export.sh
idf.py set-target ${{ matrix.soc }}
echo CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y >> sdkconfig
for codec in "${{ matrix.additional_opts }}" ; do
echo AVM_ESP_ADF_${codec}_ENABLE=y >> sdkconfig
done
idf.py build -DCONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y
- name: Run tests using qemu
shell: bash
if: matrix.soc == 'esp32' || matrix.soc == 'esp32c3'
working-directory: AtomVM/src/platforms/esp32/components/atomvm_esp_adf/tests/
run: |
# Some images have erlang-22, so latest compatible rebar is 3.18.0
wget https://github.com/erlang/rebar3/releases/download/3.18.0/rebar3
chmod +x rebar3
DEBIAN_FRONTEND=noninteractive apt install -y -q erlang erlang-eunit
./rebar3 atomvm packbeam
. $IDF_PATH/export.sh
pip install -U pytest-embedded pytest-embedded-qemu
pytest --target=${{ matrix.soc }}
- name: "Create a ${{ matrix.soc }} image"
working-directory: AtomVM/src/platforms/esp32/build
run: |
./mkimage.sh
mv atomvm-${{ matrix.soc }}.img atomvm-esp-adf-${{ matrix.soc }}-${{ matrix.idf-version }}.img
- name: "Upload ${{ matrix.soc }} artifacts"
uses: actions/upload-artifact@v4
with:
name: atomvm-esp-adf-${{ matrix.soc }}-${{ matrix.idf-version }}-image
path: AtomVM/src/platforms/esp32/build/atomvm-esp-adf-${{ matrix.soc }}-${{ matrix.idf-version }}.img
if-no-files-found: error
build-examples:
runs-on: ubuntu-latest
container: erlang:26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build examples
run: |
cd examples
for conf in */rebar.config ; do
example_dir=`dirname ${conf}`
cd ${example_dir}
rebar3 atomvm packbeam
cd ..
done
build-doc:
runs-on: ubuntu-latest
container: erlang:26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build ex_doc
run: |
rebar3 as doc ex_doc
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: doc
clang-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: Install run-clang-format
run: |
curl -sSfL https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py -o run-clang-format
chmod +x run-clang-format
- name: Check format with clang-format
run: |
./run-clang-format --style=file -r nifs/
erlfmt:
runs-on: ubuntu-latest
container: erlang:26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout erlfmt
run: |
cd ..
git clone --depth 1 -b v1.3.0 https://github.com/WhatsApp/erlfmt.git
cd erlfmt
rebar3 as release escriptize
- name: Check format with erlfmt
run: |
find . -name *.erl | xargs ../erlfmt/_build/release/bin/erlfmt -c