Skip to content

Commit

Permalink
Fix and finish setup of CI
Browse files Browse the repository at this point in the history
- Use apt erlang instead of setup-beam in esp-idf container
- Remove unnecessary git configuration
- Add missing app src file to help generate documentation
- Add missing dependencies
- Fix paths
- Add publish doc workflow

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
  • Loading branch information
pguyot committed May 7, 2024
1 parent 3b9b836 commit 6cbdf4a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 29 deletions.
43 changes: 17 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,35 @@ jobs:
idf-version:
- 'v5.1.3'
- 'v5.2.1'
otp:
- "26"
elixir_version:
- "1.16"

container: espressif/idf:release-v5.2
steps:
- name: Checkout AtomVM
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: atomvm/AtomVM
path: AtomVM

- name: Checkout atomvm_esp_adf
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: AtomVM/src/platform/esp32/components/
path: AtomVM/src/platforms/esp32/components/atomvm_esp_adf/

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir_version }}
- 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 \
libglib2.0-0 libpixman-1-0 \
gcc g++ zlib1g-dev libsdl2-2.0-0 libslirp0 libmbedtls-dev
# needed for generating AtomVM version when running in a docker container
- name: Configure Git
run: |
git config --global --add safe.directory /__w/AtomVM/AtomVM
echo -n "git rev-parse: "
git rev-parse --short HEAD
doxygen erlang-base erlang-dialyzer elixir \
gcc g++ zlib1g-dev libmbedtls-dev make cmake
- name: Build AtomVM libraries
shell: bash
Expand All @@ -76,7 +67,7 @@ jobs:
idf.py build
- name: "Create a ${{ matrix.soc }} image"
working-directory: ./src/platforms/esp32/build
working-directory: AtomVM/src/platforms/esp32/build
run: |
./mkimage.sh
ls -l *.img
Expand All @@ -85,15 +76,15 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: atomvm-${{ matrix.soc }}-image
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}.img
path: AtomVM/src/platforms/esp32/build/atomvm-${{ matrix.soc }}.img
if-no-files-found: error

build-doc:
runs-on: ubuntu-latest
container: erlang:26
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build edoc
Expand All @@ -108,7 +99,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
Expand All @@ -125,7 +116,7 @@ jobs:
container: erlang:26
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout erlfmt
run: |
cd ..
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and deploy documentation

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
doc:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container: erlang:26
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build edoc
run: |
rebar3 edoc
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: doc
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

## Usage:

1. Clone this repository into atomvm/src/platforms/esp32/components with submodules
1. Clone this repository into atomvm/src/platforms/esp32/components with
the required submodules. You can clone with recursive submodules but most
submodules are not used and the following commands will save disk space.

```bash
cd AtomVM/src/platforms/esp32/components/
git clone --recurse-submodules https://github.com/pguyot/atomvm_esp_adf.git
git clone https://github.com/pguyot/atomvm_esp_adf.git
cd atomvm_esp_adf/
git submodule update --init components/esp-adf
cd components/esp-adf/
git submodule update --init components/esp-adf-libs/
```

2. Build and flash AtomVM
Expand Down
12 changes: 12 additions & 0 deletions src/atomvm_esp_adf.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
application, atomvm_esp_adf, [
{description, "Port of ESP ADF for the AtomVM platform"},
{vsn, "0.1.0"},
{registered, []},
{applications, [kernel, stdlib]},
{env,[]},
{modules, []},
{licenses, ["MIT"]},
{links, []}
]
}.
2 changes: 1 addition & 1 deletion src/esp_adf_audio_pipeline.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ register(_AudioPipeline, _AudioElement, _Name) ->
%% @param AudioElement element to unregister
%% @return ok
-spec unregister(audio_pipeline(), audio_element:audio_element()) -> ok.
unregister(_AudioPipeline, _AudioElement, _Name) ->
unregister(_AudioPipeline, _AudioElement) ->
erlang:nif_error(undefined).

%% @doc Link audio elements, i.e. define the pipeline order.
Expand Down

0 comments on commit 6cbdf4a

Please sign in to comment.