Merge pull request #772 from pguyot/w33/optimize-temp-stack #1018
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
# | |
# Copyright 2022 Fred Dushin <[email protected]> | |
# | |
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
# | |
name: esp32-mkimage | |
on: | |
push: | |
paths: | |
- '.github/workflows/**' | |
- 'CMakeLists.txt' | |
- 'libs/**' | |
- 'src/platforms/esp32/**' | |
- 'src/libAtomVM/**' | |
- 'tools/packbeam/**' | |
pull_request: | |
paths: | |
- '.github/workflows/**' | |
- 'src/platforms/esp32/**' | |
- 'src/libAtomVM/**' | |
jobs: | |
esp32-release: | |
runs-on: ubuntu-latest | |
container: espressif/idf:v${{ matrix.idf-version }} | |
strategy: | |
matrix: | |
idf-version: ["4.4.3"] | |
cc: ["clang-10"] | |
cxx: ["clang++-10"] | |
cflags: ["-O3"] | |
otp: ["24"] | |
elixir_version: ["1.11"] | |
compiler_pkgs: ["clang-10"] | |
soc: ["esp32", "esp32c3", "esp32s2", "esp32s3"] | |
env: | |
CC: ${{ matrix.cc }} | |
CXX: ${{ matrix.cxx }} | |
CFLAGS: ${{ matrix.cflags }} | |
CXXFLAGS: ${{ matrix.cflags }} | |
ImageOS: "ubuntu20" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.otp }} | |
elixir-version: ${{ matrix.elixir_version }} | |
- name: "APT update" | |
run: apt update -y | |
- name: "Install deps" | |
run: DEBIAN_FRONTEND=noninteractive apt install -y ${{ matrix.compiler_pkgs}} git cmake gperf zlib1g-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 | |
# Builder info | |
- name: "System info" | |
run: | | |
echo "**uname:**" | |
uname -a | |
echo "**libc version:**" | |
ldd --version | |
echo "**C Compiler version:**" | |
$CC --version | |
$CXX --version | |
echo "**Linker version:**" | |
ld --version | |
echo "**CMake version:**" | |
cmake --version | |
echo "**OTP version:**" | |
cat $(dirname $(which erlc))/../releases/RELEASES || true | |
- name: "Build: create build dir" | |
run: mkdir build | |
- name: "Build: run cmake" | |
working-directory: build | |
run: | | |
cmake .. | |
# git clone will use more recent timestamps than cached beam files | |
# touch them so we can benefit from the cache and avoid costly beam file rebuild. | |
find . -name '*.beam' -exec touch {} \; | |
- name: "Build erlang and Elixir libs" | |
working-directory: build/libs | |
run: | | |
make | |
- name: "Build ${{ matrix.soc }} with idf.py" | |
shell: bash | |
working-directory: ./src/platforms/esp32/ | |
run: | | |
rm -rf build | |
. $IDF_PATH/export.sh | |
idf.py set-target ${{ matrix.soc }} | |
idf.py reconfigure | |
idf.py build | |
- name: "Create a ${{ matrix.soc }} image" | |
working-directory: ./src/platforms/esp32/build | |
run: | | |
./mkimage.sh | |
ls -l *.img | |
- name: "Upload ${{ matrix.soc }} artifacts" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: atomvm-${{ matrix.soc }}-image | |
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}-*.img | |
if-no-files-found: error |