diff --git a/.github/workflows/build-and-test-macos.yaml b/.github/workflows/build-and-test-macos.yaml deleted file mode 100644 index a02d28acc..000000000 --- a/.github/workflows/build-and-test-macos.yaml +++ /dev/null @@ -1,134 +0,0 @@ -# -# Copyright 2017-2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Build and Test on macOS - -on: - push: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - pull_request: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - build-and-test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ["macos-13", "macos-14"] - otp: ["24", "25", "26"] - - steps: - # Setup - - name: "Checkout repo" - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: "Install deps" - run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gperf doxygen erlang@${{ matrix.otp }} ninja mbedtls - - # Builder info - - name: "System info" - run: | - echo "**uname:**" - uname -a - echo "**C Compiler version:**" - clang --version - clang++ --version - echo "**CMake version:**" - cmake --version - - # Build - - name: "Build: create build dir" - run: mkdir build - - - name: "Build: run cmake" - working-directory: build - run: | - export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" - cmake -DAVM_WARNINGS_ARE_ERRORS=ON -G Ninja .. - - - name: "Build: run ninja" - working-directory: build - run: | - export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" - ninja - - - name: "Build: run dialyzer" - working-directory: build - run: | - export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" - ninja dialyzer - - # Test - - name: "Test: test-erlang" - timeout-minutes: 10 - working-directory: build - run: | - ./tests/test-erlang - - - name: "Test: test-enif" - working-directory: build - run: | - ./tests/test-enif - - - name: "Test: test-mailbox" - working-directory: build - run: | - ./tests/test-mailbox - - - name: "Test: test-structs" - timeout-minutes: 10 - working-directory: build - run: | - ./tests/test-structs - - - name: "Test: test_estdlib.avm" - timeout-minutes: 10 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm - - - name: "Test: test_eavmlib.avm" - timeout-minutes: 10 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm - - - name: "Test: test_alisp.avm" - timeout-minutes: 10 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/alisp/test_alisp.avm - - - name: "Install and smoke test" - working-directory: build - run: | - export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:/opt/homebrew/opt/erlang@${{ matrix.otp }}/bin:$PATH" - sudo ninja install - atomvm examples/erlang/hello_world.avm - atomvm -v - atomvm -h diff --git a/.github/workflows/build-and-test-on-freebsd.yaml b/.github/workflows/build-and-test-on-freebsd.yaml deleted file mode 100644 index adaa6bd2f..000000000 --- a/.github/workflows/build-and-test-on-freebsd.yaml +++ /dev/null @@ -1,133 +0,0 @@ -# -# Copyright 2023 Fred Dushin -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: build-and-test-on-freebsd - -on: - push: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - pull_request: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - build-and-test-on-freebsd: - runs-on: ubuntu-22.04 - name: Build and test AtomVM on FreeBSD - env: - ATOMVM_EXAMPLE: "atomvm-example" - steps: - - - uses: actions/checkout@v4 - - - name: Build and Test on FreeBSD - id: build-and-test-on-freebsd - uses: vmactions/freebsd-vm@v1 - timeout-minutes: 20 - with: - release: 13.2 - envs: 'ATOMVM_EXAMPLE' - usesh: true - sync: rsync - copyback: false - - prepare: | - pkg install -y curl cmake gperf erlang elixir mbedtls - - run: | - - echo "%%" - echo "%% System Info" - echo "%%" - echo "**freebsd-version:**" - freebsd-version - echo "**uname:**" - uname -a - echo "**C Compiler version:**" - clang --version - clang++ --version - echo "**CMake version:**" - cmake --version - echo "**hw.ncpu:**" - sysctl -n hw.ncpu - - echo "%%" - echo "%% Running CMake ..." - echo "%%" - mkdir build - cd build - cmake .. -DMBEDTLS_ROOT_DIR=/usr/local -DAVM_WARNINGS_ARE_ERRORS=ON - - echo "%%" - echo "%% Building AtomVM ..." - echo "%%" - make -j `sysctl -n hw.ncpu` - - echo "%%" - echo "%% Running test-erlang ..." - echo "%%" - ./tests/test-erlang - - echo "%%" - echo "%% Running test-enif ..." - echo "%%" - ./tests/test-enif - - echo "%%" - echo "%% Running test-mailbox ..." - echo "%%" - ./tests/test-mailbox - - echo "%%" - echo "%% Running test-structs ..." - echo "%%" - ./tests/test-structs - - echo "%%" - echo "%% Running estdlib tests ..." - echo "%%" - ./src/AtomVM tests/libs/estdlib/test_estdlib.avm - - echo "%%" - echo "%% Running eavmlib tests ..." - echo "%%" - ./src/AtomVM tests/libs/eavmlib/test_eavmlib.avm - - echo "%%" - echo "%% Running alisp tests ..." - echo "%%" - ./src/AtomVM tests/libs/alisp/test_alisp.avm - - echo "%%" - echo "%% Running install ..." - echo "%%" - make install - atomvm examples/erlang/hello_world.avm - atomvm -v - atomvm -h - - echo "%%" - echo "%% Done!" - echo "%%" diff --git a/.github/workflows/build-and-test-other.yaml b/.github/workflows/build-and-test-other.yaml deleted file mode 100644 index 98502a79d..000000000 --- a/.github/workflows/build-and-test-other.yaml +++ /dev/null @@ -1,183 +0,0 @@ -# -# Copyright 2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Build and Test on Other Architectures - -on: - push: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - pull_request: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - compile_tests: - runs-on: ubuntu-24.04 - container: erlang:27 - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Install required packages - run: apt update && apt install -y gperf zlib1g-dev cmake ninja-build - - - name: Compile test modules - run: | - set -e - mkdir build_tests - cd build_tests - cmake .. -G Ninja -DAVM_WARNINGS_ARE_ERRORS=ON - ninja erlang_test_modules test_estdlib test_eavmlib test_alisp - - - name: Upload test modules - uses: actions/upload-artifact@v4 - with: - name: test-modules - path: | - build_tests/**/*.avm - build_tests/**/*.beam - build_tests/**/*.hrl - retention-days: 1 - - build-and-test-other: - needs: compile_tests - runs-on: ubuntu-24.04 - - strategy: - fail-fast: false - matrix: - arch: ["arm32v5", "arm32v7", "arm64v8"] - - include: - - arch: "arm32v5" - platform: "arm/v5" - cflags: "-O2 -mthumb -mthumb-interwork -march=armv4t" - cmake_opts: "-DAVM_DISABLE_SMP=On -DAVM_DISABLE_TASK_DRIVER=On" - tag: "stretch" - sources: | - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports-sloppy main - deb [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb-src [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb [trusted=yes] http://archive.debian.org/debian/ stretch main - deb-src [trusted=yes] http://archive.debian.org/debian/ stretch main - # Workaround from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954852 - install_deps: | - apt update && - apt install -y -t stretch-backports-sloppy libarchive13 && - apt install -y -t stretch-backports cmake && - apt install -y file gcc g++ binutils make doxygen gperf zlib1g-dev libmbedtls-dev - - - arch: "arm32v7" - platform: "arm/v7" - tag: "bullseye" - # -D_FILE_OFFSET_BITS=64 is required for making atomvm:posix_readdir/1 test work - # otherwise readdir will fail due to 64 bits inode numbers with 32 bit ino_t - cflags: "-mcpu=cortex-a7 -mfloat-abi=hard -O2 -mthumb -mthumb-interwork -D_FILE_OFFSET_BITS=64" - cmake_opts: "-DAVM_WARNINGS_ARE_ERRORS=ON" - - - arch: "arm64v8" - platform: "arm64/v8" - tag: "bullseye" - cflags: "-O2" - cmake_opts: "-DAVM_WARNINGS_ARE_ERRORS=ON" - - # Required for testing big endian archs - - arch: "s390x" - platform: "s390x" - tag: "bullseye" - cflags: "-O2" - cmake_opts: "-DAVM_WARNINGS_ARE_ERRORS=ON" - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: apt update - run: sudo apt update - - - name: Install required packages - run: sudo apt install -y debootstrap - - - name: Download test modules - uses: actions/download-artifact@v4 - with: - name: test-modules - path: build_tests - - - name: Set up QEMU - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - name: "Build and Test: AtomVM on foreign arch" - timeout-minutes: 15 - run: | - docker run --platform linux/${{ matrix.platform }} --rm -v $PWD:/atomvm -w /atomvm \ - -e CFLAGS="${{ matrix.cflags }}" -e CXXFLAGS="${{ matrix.cflags }}" \ - ${{ matrix.arch }}/debian:${{ matrix.tag }} /bin/bash -c ' - ([ -n "${{ matrix.sources }}" ] && echo "${{ matrix.sources }}" > /etc/apt/sources.list || true) && - cat /etc/apt/sources.list && - if test -n "${{ matrix.install_deps }}"; then - echo - ${{ matrix.install_deps }} - else - apt update && - apt install -y file gcc g++ binutils cmake make doxygen gperf zlib1g-dev libmbedtls-dev - fi && - file /bin/bash && - uname -a && - cc --version && - ld --version && - ldd --version && - echo $CFLAGS && - echo $CXXFLAGS && - cmake --version && - mkdir -p build && - cd build && - cmake .. ${{ matrix.cmake_opts }} && - cp ../build_tests/tests/erlang_tests/*.beam tests/erlang_tests/ && - cp ../build_tests/tests/erlang_tests/code_load/*.{avm,beam,hrl} tests/erlang_tests/code_load/ && - mkdir -p tests/erlang_tests/code_load/beams/ && - cp ../build_tests/tests/erlang_tests/code_load/beams/*.beam tests/erlang_tests/code_load/beams/ && - cp ../build_tests/tests/libs/estdlib/*.avm tests/libs/estdlib/ && - cp ../build_tests/tests/libs/eavmlib/*.avm tests/libs/eavmlib/ && - cp ../build_tests/tests/libs/alisp/*.avm tests/libs/alisp/ && - make AtomVM && - make test-erlang && - make test-enif && - make test-mailbox && - make test-structs && - file ./tests/test-erlang && - ./tests/test-erlang -s prime_smp && - file ./tests/test-enif && - ./tests/test-enif && - file ./tests/test-mailbox && - ./tests/test-mailbox && - file ./tests/test-structs && - ./tests/test-structs && - file ./src/AtomVM && - ./src/AtomVM tests/libs/estdlib/test_estdlib.avm && - ./src/AtomVM tests/libs/eavmlib/test_eavmlib.avm && - ./src/AtomVM tests/libs/alisp/test_alisp.avm - ' diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml deleted file mode 100644 index b2440c9d1..000000000 --- a/.github/workflows/build-and-test.yaml +++ /dev/null @@ -1,393 +0,0 @@ -# -# Copyright 2017-2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Build and Test - -on: - push: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - pull_request: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - build-and-test: - runs-on: ${{ matrix.os }} - strategy: - - fail-fast: false - - matrix: - # Ubuntu 20.04 has gcc from 7 to 10 ("gcc" is gcc-9) - # Ubuntu 22.04 has gcc from 9 to 12 ("gcc" is gcc-11) - # Ubuntu 24.04 has gcc from 9 to 14 ("gcc" is gcc-13) - # Ubuntu 20.04 has clang 10 and 12 to ("clang" is 10) - # Ubuntu 22.04 has clang from 12 to 15 ("clang" is 14) - # Ubuntu 24.04 has clang from 14 to 18 ("clang" is 18) - # We want to test every compiler but don't need to test every OS - # We only test several OTP versions with default compilers (gcc-9, 11, 13, clang-10, 14, 18) - cc: ["gcc-9", "gcc-11", "gcc-13", "clang-10", "clang-14", "clang-18"] - cflags: ["-O3"] - otp: ["25", "26", "27"] - - include: - - cc: "gcc-7" - cxx: "g++-7" - compiler_pkgs: "gcc-7 g++-7" - os: "ubuntu-20.04" - otp: "27" - - cc: "gcc-8" - cxx: "g++-8" - compiler_pkgs: "gcc-8 g++-8" - os: "ubuntu-20.04" - otp: "27" - - cc: "gcc-9" - cxx: "g++-9" - compiler_pkgs: "gcc-9 g++-9" - os: "ubuntu-20.04" - # otp: all - - cc: "gcc-10" - cxx: "g++-10" - compiler_pkgs: "gcc-10 g++-10" - # Use Werror for recent GCC versions that have better diagnostics - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-22.04" - otp: "27" - - cc: "gcc-11" - cxx: "g++-11" - compiler_pkgs: "gcc-11 g++-11" - # Use Werror for recent GCC versions that have better diagnostics - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-22.04" - # otp: all - - cc: "gcc-12" - cxx: "g++-12" - compiler_pkgs: "gcc-12 g++-12" - # Use Werror for recent GCC versions that have better diagnostics - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - otp: "27" - - cc: "gcc-13" - cxx: "g++-13" - compiler_pkgs: "gcc-13 g++-13" - # Use Werror for recent GCC versions that have better diagnostics - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - # otp: all - - cc: "gcc-14" - cxx: "g++-14" - compiler_pkgs: "gcc-14 g++-14" - # Use Werror for recent GCC versions that have better diagnostics - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - otp: "27" - - - cc: "clang-10" - cxx: "clang++-10" - compiler_pkgs: "clang-10" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-20.04" - # otp: all - - cc: "clang-11" - cxx: "clang++-11" - compiler_pkgs: "clang-11" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-20.04" - otp: "27" - - cc: "clang-12" - cxx: "clang++-12" - compiler_pkgs: "clang-12" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-22.04" - otp: "27" - - cc: "clang-13" - cxx: "clang++-13" - compiler_pkgs: "clang-13" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-22.04" - otp: "27" - - cc: "clang-14" - cxx: "clang++-14" - compiler_pkgs: "clang-14" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-22.04" - # otp: all - - cc: "clang-15" - cxx: "clang++-15" - compiler_pkgs: "clang-15" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - otp: "27" - - cc: "clang-16" - cxx: "clang++-16" - compiler_pkgs: "clang-16" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - otp: "27" - - cc: "clang-17" - cxx: "clang++-17" - compiler_pkgs: "clang-17" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - otp: "27" - - cc: "clang-18" - cxx: "clang++-18" - compiler_pkgs: "clang-18" - cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON" - os: "ubuntu-24.04" - # otp: all - - - otp: "25" - elixir_version: "1.14" - - - otp: "26" - elixir_version: "1.17" - - - otp: "27" - elixir_version: "1.17" - - # Old versions of OTP/Elixir - - os: "ubuntu-20.04" - cc: "cc" - cxx: "c++" - otp: "21" - cflags: "" - elixir_version: "1.7" - - - os: "ubuntu-20.04" - cc: "cc" - cxx: "c++" - otp: "22" - cflags: "" - elixir_version: "1.8" - - - os: "ubuntu-20.04" - cc: "cc" - cxx: "c++" - otp: "23" - cflags: "" - elixir_version: "1.11" - - - os: "ubuntu-22.04" - cc: "cc" - cxx: "c++" - otp: "24" - cflags: "" - elixir_version: "1.14" - -# TODO: enable master again -# master will not work until we don't adapt to atom table changes -# # master/main version of OTP/Elixir -# - os: "ubuntu-24.04" -# cc: "cc" -# cxx: "c++" -# otp: "master" -# elixir_version: "main" - - # Additional default compiler builds - - os: "ubuntu-20.04" - cc: "cc" - cxx: "c++" - otp: "27" - cflags: "" - elixir_version: "1.17" - - - os: "ubuntu-22.04" - cc: "cc" - cxx: "c++" - otp: "27" - cflags: "" - elixir_version: "1.17" - - # Additional latest & -Os compiler builds - - os: "ubuntu-24.04" - cc: "gcc-14" - cxx: "g++-14" - otp: "27" - cflags: "-Os" - elixir_version: "1.17" - compiler_pkgs: "gcc-14 g++-14" - - - os: "ubuntu-24.04" - cc: "clang-18" - cxx: "clang++-18" - otp: "27" - cflags: "-Os" - elixir_version: "1.17" - compiler_pkgs: "clang-18" - - # Additional 32 bits build - - os: "ubuntu-20.04" - cc: "gcc-10" - cxx: "g++-10" - cflags: "-m32 -O3" - otp: "23" - elixir_version: "1.11" - # Use Werror so we get an error with 32 bit specific warnings - cmake_opts_other: "-DAVM_CREATE_STACKTRACES=off -DAVM_WARNINGS_ARE_ERRORS=ON" - arch: "i386" - compiler_pkgs: "gcc-10 g++-10 gcc-10-multilib g++-10-multilib libc6-dev-i386 - libc6-dbg:i386 zlib1g-dev:i386 libmbedtls-dev:i386" - - env: - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - CFLAGS: ${{ matrix.cflags }} - CXXFLAGS: ${{ matrix.cflags }} - - steps: - # Setup - - name: "Checkout repo" - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ matrix.otp }} - elixir-version: ${{ matrix.elixir_version }} - hexpm-mirrors: | - https://builds.hex.pm - https://repo.hex.pm - https://cdn.jsdelivr.net/hex - - - name: "Add i386 architecture" - if: matrix.arch == 'i386' - run: sudo dpkg --add-architecture i386 - - - name: "APT update" - run: sudo apt update -y - - - name: "Install deps" - run: sudo apt install -y ${{ matrix.compiler_pkgs}} cmake gperf zlib1g-dev doxygen valgrind libmbedtls-dev - - # 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 - - # Build - - name: "Build: create build dir" - run: mkdir build - - - uses: actions/cache@v4 - id: cache - with: - path: 'build/tests/**/*.beam' - key: ${{ matrix.otp }}-${{ hashFiles('**/build-and-test.yaml', 'tests/**/*.erl') }} - - - name: "Build: run cmake" - working-directory: build - run: | - cmake ${{ matrix.cmake_opts_fp }} ${{ matrix.cmake_opts_smp }} ${{ matrix.cmake_opts_other }} .. - # 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: run make" - working-directory: build - run: make - - - name: "Build: run dialyzer" - working-directory: build - run: make dialyzer - - # Test - - name: "Test: test-erlang" - timeout-minutes: 15 - working-directory: build - run: | - ./tests/test-erlang -s prime_smp - valgrind ./tests/test-erlang -s prime_smp - - - name: "Test: test-enif" - working-directory: build - run: | - ./tests/test-enif - valgrind ./tests/test-enif - - - name: "Test: test-mailbox" - working-directory: build - run: | - ./tests/test-mailbox - valgrind ./tests/test-mailbox - - - name: "Test: test-structs" - timeout-minutes: 10 - working-directory: build - run: | - ./tests/test-structs - valgrind ./tests/test-structs - - - name: "Test: test_estdlib.avm" - timeout-minutes: 5 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm - valgrind ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm - - - name: "Test: test_eavmlib.avm" - timeout-minutes: 10 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm - valgrind ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm - - - name: "Test: test_alisp.avm" - timeout-minutes: 10 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/alisp/test_alisp.avm - valgrind ./src/AtomVM ./tests/libs/alisp/test_alisp.avm - - - name: "Test: Tests.avm (Elixir)" - timeout-minutes: 10 - working-directory: build - run: | - if command -v elixirc &> /dev/null - then - ./src/AtomVM ./tests/libs/exavmlib/Tests.avm - valgrind ./src/AtomVM ./tests/libs/exavmlib/Tests.avm - fi - - - name: "Install and smoke test" - working-directory: build - run: | - sudo PATH=${PATH} make install - atomvm examples/erlang/hello_world.avm - atomvm -v - atomvm -h diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml deleted file mode 100644 index 34cb4a63f..000000000 --- a/.github/workflows/build-docs.yaml +++ /dev/null @@ -1,126 +0,0 @@ -# -# Copyright 2023 Winford (Uncle Grumpy) -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# -# This is a workflow for atomvm/AtomVM to Publish API documentation and other content from the `doc` directory to -# atomvm.net hosted on GitHub Pages - -name: Build Docs - -# Controls when the workflow will run -on: - # Triggers the workflow on push request and tag events on main branch - pull_request: - tags: - - '**' - branches: - - 'main' - - 'release-**' - paths: - - '.github/workflows/**' - - 'CMakeLists.txt' - - 'doc/**' - - 'libs/**' - - 'src/libAtomVM/**' - - 'UPDATING.md' - - 'CONTRIBUTING.md' - - 'CHANGELOG.md' - - 'CODE_OF_CONDUCT.md' - push: - repositories: - - '!atomvm/AtomVM' - paths: - - '.github/workflows/**' - - 'CMakeLists.txt' - - 'doc/**' - - 'libs/**' - - 'src/libAtomVM/**' - - 'UPDATING.md' - - 'CONTRIBUTING.md' - - 'CHANGELOG.md' - - 'CODE_OF_CONDUCT.md' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - - strategy: - fail-fast: false - ## don't add more than one OS to matrix, this is only to retrieve the full os-name for keeping cache in sync - matrix: - os: [ ubuntu-24.04 ] - # The type of runner that the job will run on - runs-on: ${{ matrix.os }} - # Documentation currently fails to build with OTP-27 and recent OTP-26. - container: erlang:26.0.2 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Install Deps - run: | - apt update -y - DEBIAN_FRONTEND=noninteractive apt install -y git cmake doxygen graphviz python3-pip python3-virtualenv python3-setuptools python3-stemmer wget - - - uses: actions/cache@v4 - id: sphinx-cache - with: - path: /home/runner/python-env/sphinx - key: ${{ matrix.os }}-${{ job.container.id }}-sphinx-install - - - name: Install Sphinx - if: ${{ steps.sphinx-cache.outputs.cache-hit != 'true' }} - run: | - virtualenv /home/runner/python-env/sphinx - . /home/runner/python-env/sphinx/bin/activate - python3 -m pip install sphinx - python3 -m pip install myst-parser - python3 -m pip install sphinx-rtd-theme - python3 -m pip install rinohtype - python3 -m pip install pillow - python3 -m pip install gitpython - python3 -m pip install breathe - python3 -m pip install pygments - - - name: Set docs target name - shell: bash - run: | - if [[ ${{ github.ref_name }} == *"/merge" ]]; then - echo "AVM_DOCS_NAME=${{github.event.pull_request.base.ref}}" >> "$GITHUB_ENV"; - else - echo "AVM_DOCS_NAME=${{ github.ref_name }}" >> "$GITHUB_ENV"; - fi - - - uses: actions/checkout@v4 - with: - repository: ${{ vars.GITHUB_REPOSITORY }} - fetch-depth: 0 - - - name: Track all branches - shell: bash - run: | - git config --global --add safe.directory /__w/AtomVM/AtomVM - for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}"`; do - git branch --track ${branch#remotes/origin/} $branch - done - - - name: Build Site - id: build - shell: bash - run: | - . /home/runner/python-env/sphinx/bin/activate - git config --global --add safe.directory ${PWD} - mkdir build - cd build - cmake .. - cd doc - make GitHub_CI_Publish_Docs diff --git a/.github/workflows/build-libraries.yaml b/.github/workflows/build-libraries.yaml deleted file mode 100644 index 1eec21986..000000000 --- a/.github/workflows/build-libraries.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# -# Copyright 2017-2023 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Build Libraries - -on: - push: - tags: - - '**' - -permissions: - contents: write - -jobs: - build-libraries: - runs-on: "ubuntu-22.04" - strategy: - fail-fast: false - - steps: - - name: "Checkout repo" - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - uses: erlef/setup-beam@v1 - with: - otp-version: "24" - elixir-version: "1.11" - - - name: "APT update" - run: sudo apt update -y - - - name: "Install deps" - run: sudo apt install -y build-essential cmake gperf zlib1g-dev libmbedtls-dev valgrind - - # Builder info - - name: "System info" - run: | - echo "**uname:**" - uname -a - echo "**libc version:**" - ldd --version - echo "**C Compiler version:**" - cc --version - c++ --version - echo "**Linker version:**" - ld --version - echo "**CMake version:**" - cmake --version - echo "**OTP version:**" - cat $(dirname $(which erlc))/../releases/RELEASES || true - - # Build - - name: "Build: create build dir" - run: mkdir build - - - name: "Build: run cmake" - working-directory: build - run: | - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. - - - name: "Build: run make" - working-directory: build - run: make - - - name: "Build: run dialyzer" - working-directory: build - run: make dialyzer - - - name: "Test: test_estdlib.avm" - timeout-minutes: 10 - working-directory: build - run: | - ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm - valgrind ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm - - - name: "Rename and write sha256sum" - working-directory: build - run: | - ATOMVMLIB_FILE=atomvmlib-${{ github.ref_name }}.avm - mv libs/atomvmlib.avm "libs/${ATOMVMLIB_FILE}" && - sha256sum "libs/${ATOMVMLIB_FILE}" > "libs/${ATOMVMLIB_FILE}.sha256" - HELLO_WORLD_FILE=hello_world-${{ github.ref_name }}.avm - mv examples/erlang/hello_world.avm "examples/erlang/${HELLO_WORLD_FILE}" - sha256sum "examples/erlang/${HELLO_WORLD_FILE}" > "examples/erlang/${HELLO_WORLD_FILE}.sha256" - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - fail_on_unmatched_files: true - files: | - build/libs/atomvmlib-${{ github.ref_name }}.avm - build/libs/atomvmlib-${{ github.ref_name }}.avm.sha256 - build/examples/erlang/hello_world-${{ github.ref_name }}.avm - build/examples/erlang/hello_world-${{ github.ref_name }}.avm.sha256 diff --git a/.github/workflows/build-linux-artifacts.yaml b/.github/workflows/build-linux-artifacts.yaml deleted file mode 100644 index e45c781bc..000000000 --- a/.github/workflows/build-linux-artifacts.yaml +++ /dev/null @@ -1,254 +0,0 @@ -# -# Copyright 2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Build Linux Artifacts - -on: - push: - tags: - - '**' - -permissions: - contents: write - -env: - otp_version: 24 - elixir_version: 1.14 - -jobs: - compile_tests: - runs-on: ubuntu-22.04 - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.otp_version }} - elixir-version: ${{ env.elixir_version }} - - - name: apt update - run: sudo apt update - - - name: Install required packages - run: sudo apt install -y gperf - - - name: Compile test modules - run: | - set -e - mkdir build_tests - cd build_tests - cmake .. - make erlang_test_modules - make test_estdlib - make test_eavmlib - make test_alisp - - - name: Upload test modules - uses: actions/upload-artifact@v4 - with: - name: test-modules - path: | - build_tests/**/*.avm - build_tests/**/*.beam - build_tests/**/*.hrl - retention-days: 1 - - build-and-test-other: - needs: compile_tests - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - include: - - arch: "arm32v5" - build_name: "linux-arm32v5" - docker_image: "arm32v5/debian" - platform: "arm/v5" - cflags: "-mthumb -mthumb-interwork -march=armv4t" - cmake_opts: "-DAVM_DISABLE_SMP=On -DAVM_DISABLE_TASK_DRIVER=On" - tag: "stretch" - sources: | - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports-sloppy main - deb [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb-src [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb [trusted=yes] http://archive.debian.org/debian/ stretch main - deb-src [trusted=yes] http://archive.debian.org/debian/ stretch main - # Workaround from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954852 - install_deps: | - apt update && - apt install -y -t stretch-backports-sloppy libarchive13 && - apt install -y -t stretch-backports cmake && - apt install -y file gcc g++ binutils make doxygen gperf zlib1g-dev libmbedtls-dev tzdata - - - arch: "arm32v7" - build_name: "linux-arm32v7thl" - docker_image: "arm32v7/debian" - platform: "arm/v7" - tag: "stretch" - cflags: "-mfloat-abi=hard -mthumb -mthumb-interwork" - sources: | - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports-sloppy main - deb [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb-src [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb [trusted=yes] http://archive.debian.org/debian/ stretch main - deb-src [trusted=yes] http://archive.debian.org/debian/ stretch main - # Workaround from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954852 - install_deps: | - apt update && - apt install -y -t stretch-backports-sloppy libarchive13 && - apt install -y -t stretch-backports cmake && - apt install -y file gcc g++ binutils make doxygen gperf zlib1g-dev libmbedtls-dev tzdata - - - arch: "arm64v8" - build_name: "linux-arm64v8" - docker_image: "arm64v8/ubuntu" - platform: "arm64/v8" - tag: "22.04" - cflags: "" - - - arch: "riscv64" - build_name: "linux-riscv64" - docker_image: "riscv64/ubuntu" - platform: "riscv64" - tag: "22.04" - cflags: "" - - - arch: "x86_64" - build_name: "linux-x86_64-static-mbedtls" - docker_image: "ubuntu" - platform: "amd64" - tag: "18.04" - cflags: "" - cmake_opts: "-DAVM_STATIC_MBEDTLS=ON" - install_deps: | - apt update && - apt install -y file gcc g++ binutils make doxygen gperf zlib1g-dev libmbedtls-dev wget tzdata && - apt purge -y cmake && - wget https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.tar.gz && - tar xf cmake-3.13.5-Linux-x86_64.tar.gz && - mv cmake-3.13.5-Linux-x86_64 /opt/cmake-3.13.5 && - ln -sf /opt/cmake-3.13.5/bin/* /usr/bin/ - - - arch: "x86_64" - build_name: "linux-x86_64" - docker_image: "ubuntu" - platform: "amd64" - tag: "18.04" - cflags: "" - install_deps: | - apt update && - apt install -y file gcc g++ binutils make doxygen gperf zlib1g-dev libmbedtls-dev wget tzdata && - apt purge -y cmake && - wget https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.tar.gz && - tar xf cmake-3.13.5-Linux-x86_64.tar.gz && - mv cmake-3.13.5-Linux-x86_64 /opt/cmake-3.13.5 && - ln -sf /opt/cmake-3.13.5/bin/* /usr/bin/ - - - arch: "i386" - build_name: "linux-i386" - docker_image: "i386/debian" - platform: "386" - cflags: "" - tag: "stretch" - sources: | - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main - deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports-sloppy main - deb [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb-src [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main - deb [trusted=yes] http://archive.debian.org/debian/ stretch main - deb-src [trusted=yes] http://archive.debian.org/debian/ stretch main - # Workaround from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954852 - install_deps: | - apt update && - apt install -y -t stretch-backports-sloppy libarchive13 && - apt install -y -t stretch-backports cmake && - apt install -y file gcc g++ binutils make doxygen gperf zlib1g-dev libmbedtls-dev - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: apt update - run: sudo apt update - - - name: Install required packages - run: sudo apt install -y debootstrap - - - name: Download test modules - uses: actions/download-artifact@v4 - with: - name: test-modules - path: build_tests - - - name: Set up QEMU - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - name: Build AtomVM using docker - timeout-minutes: 15 - run: | - docker run --platform linux/${{ matrix.platform }} --rm -v $PWD:/atomvm -w /atomvm \ - -e CFLAGS="${{ matrix.cflags }}" -e CXXFLAGS="${{ matrix.cflags }}" \ - ${{ matrix.docker_image }}:${{ matrix.tag }} /bin/bash -c ' - ([ -n "${{ matrix.sources }}" ] && echo "${{ matrix.sources }}" > /etc/apt/sources.list || true) && - cat /etc/apt/sources.list && - if test -n "${{ matrix.install_deps }}"; then - echo - ${{ matrix.install_deps }} - else - apt update && - apt install -y file gcc g++ binutils cmake make doxygen gperf zlib1g-dev libmbedtls-dev tzdata - fi && - file /bin/bash && - uname -a && - cc --version && - ld --version && - ldd --version && - echo $CFLAGS && - echo $CXXFLAGS && - cmake --version && - mkdir -p build && - cd build && - cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ matrix.cmake_opts }} && - cp ../build_tests/tests/erlang_tests/*.beam tests/erlang_tests/ && - cp ../build_tests/tests/erlang_tests/code_load/*.{avm,beam,hrl} tests/erlang_tests/code_load/ && - mkdir -p tests/erlang_tests/code_load/beams/ && - cp ../build_tests/tests/erlang_tests/code_load/beams/*.beam tests/erlang_tests/code_load/beams/ && - cp ../build_tests/tests/libs/estdlib/*.avm tests/libs/estdlib/ && - cp ../build_tests/tests/libs/eavmlib/*.avm tests/libs/eavmlib/ && - cp ../build_tests/tests/libs/alisp/*.avm tests/libs/alisp/ && - VERBOSE=1 make AtomVM && - make test-erlang && - make test-enif && - make test-mailbox && - make test-structs && - file ./tests/test-erlang && - ./tests/test-erlang -s prime_smp && - file ./tests/test-enif && - ./tests/test-enif && - file ./tests/test-mailbox && - ./tests/test-mailbox && - file ./tests/test-structs && - ./tests/test-structs && - file ./src/AtomVM && - ./src/AtomVM tests/libs/estdlib/test_estdlib.avm && - ./src/AtomVM tests/libs/eavmlib/test_eavmlib.avm && - ./src/AtomVM tests/libs/alisp/test_alisp.avm && - cp ./src/AtomVM ./AtomVM-${{ matrix.build_name }}-${{ github.ref_name }} && - sha256sum ./src/AtomVM > ./AtomVM-${{ matrix.build_name }}-${{ github.ref_name }}.sha256 - ' - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - fail_on_unmatched_files: true - files: | - build/AtomVM* diff --git a/.github/workflows/check-formatting.yaml b/.github/workflows/check-formatting.yaml deleted file mode 100644 index 18a1b62e7..000000000 --- a/.github/workflows/check-formatting.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright 2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: "Check formatting" - -on: - push: - paths: - - '.github/workflows/**' - - 'CMakeLists.txt' - - 'src/**' - - 'tests/**' - - '**/*.erl' - pull_request: - paths: - - '.github/workflows/**' - - 'CMakeLists.txt' - - 'src/**' - - 'tests/**' - - '**/*.erl' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - clang-format-prettier-check: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - name: "Install run-clang-format" - run: | - wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list - echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list - sudo apt-get update - sudo apt-get install -y clang-format-16 - 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 formatting with clang-format" - run: | - ./run-clang-format --style=file --clang-format-executable=clang-format-16 -r src/ tests/ - - - name: "Check formatting with prettier" - if: success() || failure() - run: | - npm install prettier - find ../src/platforms/emscripten/ ../examples/emscripten/ -name "*.js" -o -name "*.html" | xargs npx prettier -c - - erlfmt-check: - runs-on: ubuntu-24.04 - container: erlang:27 - steps: - - uses: actions/checkout@v4 - - - name: "Check formatting with Erlang fmt" - run: | - cd .. - git clone --depth 1 -b v1.1.0 https://github.com/WhatsApp/erlfmt.git - cd erlfmt - rebar3 as release escriptize - cd ../AtomVM - find . -name *.erl | xargs ../erlfmt/_build/release/bin/erlfmt -c - - mix-format-check: - runs-on: ubuntu-24.04 - container: elixir:1.17.1 - steps: - - uses: actions/checkout@v4 - - - name: "Check formatting with Elixir mix format" - run: | - cd libs/exavmlib/ - mix format --check-formatted diff --git a/.github/workflows/codechecker.yaml b/.github/workflows/codechecker.yaml new file mode 100644 index 000000000..4b1124c3b --- /dev/null +++ b/.github/workflows/codechecker.yaml @@ -0,0 +1,112 @@ +# +# Copyright 2024 Peter Madsen-Mygdal +# +# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +# +# CodeChecker-Action https://github.com/whisperity/CodeChecker-Action +# for running +# CodeChecker https://github.com/Ericsson/CodeChecker/ +# +# Outputs html code analysis report in the GH action, available for download. +# +# Will optionally upload to a CodeChecker Web server +# if the following GH _repository_ variable are set: +# +# CODECHECKER_STORE_PRODUCT_URI eg. https://server.com/product (NB no trailing slash) +# +# requires the following GH _repository_ secrets to be set +# CODECHECKER_STORE_USER user_name with PRODUCT_STORE and PRODUCT_VIEW permission +# CODECHECKER_STORE_PASSWORD password +# + +name: "CodeChecker" + +on: + push: + paths-ignore: + - "libs/**" + - "doc/**" + - "LICENSES/**" + - "*.Md" + - "*.md" + pull_request: + paths-ignore: + - "libs/**" + - "doc/**" + - "LICENSES/**" + - "*.Md" + - "*.md" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/master' && github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + analyze: + name: CodeChecker Analyze + runs-on: ubuntu-22.04 + env: + CC: gcc-13 + CXX: g++-13 + CC_ANALYZER_BIN: gcc:/usr/bin/g++-13 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["cpp"] + + steps: + - uses: erlef/setup-beam@v1 + with: + otp-version: 25 + elixir-version: 1.15 + - name: "APT update" + run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update -y + + - name: "Install deps" + run: sudo apt install -y gcc-13 g++-13 cmake gperf zlib1g-dev ninja-build erlang libmbedtls-dev cppcheck valgrind + + - name: "Checkout repository" + uses: actions/checkout@v4 + + - name: "Prepare Build" + run: | + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF + + - uses: whisperity/codechecker-analysis-action@v1 + id: codechecker + with: + version: 6.23.1 + ctu: true + build-command: "cd ${{ github.workspace }}/build; make" + store: ${{ github.event_name == 'push' && vars.CODECHECKER_STORE_PRODUCT_URI != '' }} + store-url: ${{ vars.CODECHECKER_STORE_PRODUCT_URI }} + store-username: ${{ secrets.CODECHECKER_STORE_USER }} + store-password: ${{ secrets.CODECHECKER_STORE_PASSWORD }} + diff: ${{ github.event_name == 'pull_request' && vars.CODECHECKER_STORE_PRODUCT_URI != '' }} + diff-url: ${{ vars.CODECHECKER_STORE_PRODUCT_URI }} + diff-username: ${{ secrets.CODECHECKER_STORE_USER }} + diff-password: ${{ secrets.CODECHECKER_STORE_PASSWORD }} + + - name: Output URL if successfully stored + if: ${{ steps.codechecker.outputs.store-successful == 'true' }} + run: echo "[🚀 Analysis available here ->](${{vars.CODECHECKER_STORE_PRODUCT_URI}}/runs)" >> $GITHUB_STEP_SUMMARY + + # Upload the results to the CI. + - uses: actions/upload-artifact@v4 + with: + name: "CodeChecker Bug Reports" + path: ${{ steps.codechecker.outputs.result-html-dir }} + + # Upload the results to the CI, if diff resulted in additional warnings. + - uses: actions/upload-artifact@v4 + if: ${{ steps.codechecker.outputs.warnings-in-diff == 'true' }} + with: + name: "New introduced results Bug Reports" + path: ${{ steps.codechecker.outputs.diff-html-dir }} diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml deleted file mode 100644 index f8e9ae190..000000000 --- a/.github/workflows/codeql-analysis.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# -# Copyright 2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: "CodeQL" - -on: - push: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'libs/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - pull_request: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'libs/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - schedule: - - cron: '45 18 * * 5' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: "APT update" - run: sudo apt update -y - - - name: "Install deps" - run: sudo apt install -y cmake gperf zlib1g-dev ninja-build erlang - - - name: "Checkout repository" - uses: actions/checkout@v4 - - - name: "Initialize CodeQL" - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql - - - name: "Build" - run: | - mkdir build - cd build - cmake .. -G Ninja - ninja - - - name: "Perform CodeQL Analysis" - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/esp32-build.yaml b/.github/workflows/esp32-build.yaml deleted file mode 100644 index 1536cda20..000000000 --- a/.github/workflows/esp32-build.yaml +++ /dev/null @@ -1,150 +0,0 @@ -# -# Copyright 2022 Davide Bettio -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: ESP32 Builds - -on: - push: - paths: - - '.github/workflows/esp32-build.yaml' - - 'CMakeLists.txt' - - 'libs/**' - - 'src/platforms/esp32/**' - - 'src/platforms/esp32/**/**' - - 'src/libAtomVM/**' - - 'tools/packbeam/**' - pull_request: - paths: - - '.github/workflows/esp32-build.yaml' - - 'src/platforms/esp32/**' - - 'src/platforms/esp32/**/**' - - 'src/libAtomVM/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - esp-idf: - runs-on: ubuntu-latest - container: espressif/idf:${{ matrix.idf-version }} - - strategy: - fail-fast: false - - matrix: - esp-idf-target: ["esp32", "esp32c3"] - idf-version: - - 'v5.0.7' - - 'v5.1.4' - - 'v5.2.2' - - 'v5.3.1' - - exclude: - - esp-idf-target: "esp32c3" - idf-version: 'v5.0.7' - - esp-idf-target: "esp32c3" - idf-version: 'v5.1.4' - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Build with idf.py - shell: bash - working-directory: ./src/platforms/esp32/ - run: | - . $IDF_PATH/export.sh - export IDF_TARGET=${{matrix.esp-idf-target}} - idf.py set-target ${{matrix.esp-idf-target}} - idf.py build - idf.py size - - name: Print component size info with idf.py - shell: bash - working-directory: ./src/platforms/esp32/ - run: | - . $IDF_PATH/export.sh - idf.py size-components - - - name: Install dependencies to build host AtomVM and run qemu - run: | - set -eu - apt update - DEBIAN_FRONTEND=noninteractive apt install -y -q \ - doxygen erlang-base erlang-dialyzer \ - libglib2.0-0 libpixman-1-0 \ - gcc g++ zlib1g-dev libsdl2-2.0-0 libslirp0 libmbedtls-dev - - - name: Install qemu binary from espressif/qemu esp32 - if: runner.arch != 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32' - run: | - set -eu - QEMU_VER=esp-develop-9.0.0-20240606 - QEMU_XTENSA_DIST=qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-x86_64-linux-gnu.tar.xz - QEMU_XTENSA_SHA256=071d117c44a6e9a1bc8664ab63b592d3e17ceb779119dcb46c59571a4a7a88c9 - wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_XTENSA_DIST} - echo "${QEMU_XTENSA_SHA256} *${QEMU_XTENSA_DIST}" | sha256sum --check --strict - - tar -xf ${QEMU_XTENSA_DIST} -C /opt && rm ${QEMU_XTENSA_DIST} - - - name: Install qemu binary from espressif/qemu esp32c3 - if: runner.arch != 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32c3' - run: | - set -eu - QEMU_VER=esp-develop-9.0.0-20240606 - QEMU_RISCV32_DIST=qemu-riscv32-softmmu-esp_develop_9.0.0_20240606-x86_64-linux-gnu.tar.xz - QEMU_RISCV32_SHA256=47120e826cfec7180db8cb611a7a4aed2e9b2191c2a739194f8ce085e63cdd8d - wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_RISCV32_DIST} - echo "${QEMU_RISCV32_SHA256} *${QEMU_RISCV32_DIST}" | sha256sum --check --strict - - tar -xf ${QEMU_RISCV32_DIST} -C /opt && rm ${QEMU_RISCV32_DIST} - - - name: Install qemu binary from espressif/qemu ARM64 esp32 - if: runner.arch == 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32' - run: | - set -eu - QEMU_VER=esp-develop-9.0.0-20240606 - QEMU_XTENSA_DIST=qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-aarch64-linux-gnu.tar.xz - QEMU_XTENSA_SHA256=43552f32b303a6820d0d9551903e54fc221aca98ccbd04e5cbccbca881548008 - wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_XTENSA_DIST} - echo "${QEMU_XTENSA_SHA256} *${QEMU_XTENSA_DIST}" | sha256sum --check --strict - - tar -xf ${QEMU_XTENSA_DIST} -C /opt && rm ${QEMU_XTENSA_DIST} - - - name: Install qemu binary from espressif/qemu ARM64 esp32c3 - if: runner.arch == 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32c3' - run: | - set -eu - QEMU_VER=esp-develop-9.0.0-20240606 - QEMU_RISCV32_DIST=qemu-riscv32-softmmu-esp_develop_9.0.0_20240606-aarch64-linux-gnu.tar.xz - QEMU_RISCV32_SHA256=3b6221a8b1881d2c9b9fa0b0bf8d7065c84153d2a54e429307bde9feae235c27 - wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_RISCV32_DIST} - echo "${QEMU_RISCV32_SHA256} *${QEMU_RISCV32_DIST}" | sha256sum --check --strict - - tar -xf ${QEMU_RISCV32_DIST} -C /opt && rm ${QEMU_RISCV32_DIST} - - - name: Install pytest and pytest-embedded plugins - run: | - set -e - . $IDF_PATH/export.sh - pip install pytest==8.2.2 \ - pytest-embedded==1.10.3 \ - pytest-embedded-serial-esp==1.10.3 \ - pytest-embedded-idf==1.10.3 \ - pytest-embedded-qemu==1.10.3 - - - name: Build ESP32 tests using idf.py - working-directory: ./src/platforms/esp32/test/ - run: | - set -e - . $IDF_PATH/export.sh - export IDF_TARGET=${{matrix.esp-idf-target}} - idf.py set-target ${{matrix.esp-idf-target}} - idf.py build - - - name: Run ESP32 tests using qemu - working-directory: ./src/platforms/esp32/test/ - timeout-minutes: 10 - run: | - set -e - . $IDF_PATH/export.sh - export PATH=/opt/qemu/bin:${PATH} - pytest --target=${{matrix.esp-idf-target}} --embedded-services=idf,qemu -s diff --git a/.github/workflows/esp32-mkimage.yaml b/.github/workflows/esp32-mkimage.yaml deleted file mode 100644 index 001a15d69..000000000 --- a/.github/workflows/esp32-mkimage.yaml +++ /dev/null @@ -1,175 +0,0 @@ -# -# Copyright 2022 Fred Dushin -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: esp32-mkimage - -on: - push: - paths: - - '.github/workflows/esp32-mkimage.yaml' - - 'CMakeLists.txt' - - 'libs/**' - - 'src/platforms/esp32/**' - - 'src/platforms/esp32/**/**' - - 'src/libAtomVM/**' - - 'tools/packbeam/**' - pull_request: - paths: - - '.github/workflows/esp32-mkimage.yaml' - - 'src/platforms/esp32/**' - - 'src/platforms/esp32/**/**' - - 'src/libAtomVM/**' - -permissions: - contents: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - esp32-release: - runs-on: ubuntu-22.04 - container: espressif/idf:v${{ matrix.idf-version }} - - strategy: - matrix: - idf-version: ["5.3.1"] - cc: ["clang-14"] - cxx: ["clang++-14"] - cflags: ["-O3"] - otp: ["27"] - elixir_version: ["1.17"] - compiler_pkgs: ["clang-14"] - soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c6", "esp32h2"] - flavor: ["", "-elixir"] - - env: - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - CFLAGS: ${{ matrix.cflags }} - CXXFLAGS: ${{ matrix.cflags }} - ImageOS: "ubuntu22" - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ matrix.otp }} - elixir-version: ${{ matrix.elixir_version }} - hexpm-mirrors: | - https://builds.hex.pm - https://repo.hex.pm - https://cdn.jsdelivr.net/hex - - - 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: "Use release defaults" - if: startsWith(github.ref, 'refs/tags/') - shell: bash - working-directory: ./src/platforms/esp32/ - run: | - cp sdkconfig.release-defaults sdkconfig.defaults - - - name: "Build ${{ matrix.soc }}${{ matrix.flavor }} with idf.py" - shell: bash - working-directory: ./src/platforms/esp32/ - run: | - rm -rf build - . $IDF_PATH/export.sh - if [ ! -z "${{ matrix.flavor }}" ] - then - mv partitions${{ matrix.flavor }}.csv partitions.csv - fi - idf.py set-target ${{ matrix.soc }} - idf.py reconfigure - idf.py build - - - name: "Create a ${{ matrix.soc }}${{ matrix.flavor }} image" - working-directory: ./src/platforms/esp32/build - run: | - if [ -z "${{ matrix.flavor }}" ] - then - ./mkimage.sh - else - FLAVOR_SUFFIX=$(echo "${{ matrix.flavor }}" | sed 's/-//g') - BOOT_FILE="../../../../build/libs/esp32boot/${FLAVOR_SUFFIX}_esp32boot.avm" - ./mkimage.sh --boot "$BOOT_FILE" - mv atomvm-${{ matrix.soc }}.img atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img - fi - ls -l *.img - - - name: "Upload ${{ matrix.soc }} artifacts" - uses: actions/upload-artifact@v4 - with: - name: atomvm-${{ matrix.soc }}${{ matrix.flavor }}-image - path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img - if-no-files-found: error - - - name: "Rename and write sha256sum" - if: startsWith(github.ref, 'refs/tags/') - shell: bash - working-directory: src/platforms/esp32/build - run: | - ATOMVM_IMG="AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img" - mv atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img "${ATOMVM_IMG}" - sha256sum "${ATOMVM_IMG}" > "${ATOMVM_IMG}.sha256" - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - fail_on_unmatched_files: true - files: | - src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img - src/platforms/esp32/build/AtomVM-${{ matrix.soc }}${{ matrix.flavor }}-${{ github.ref_name }}.img.sha256 diff --git a/.github/workflows/pico-build.yaml b/.github/workflows/pico-build.yaml deleted file mode 100644 index 0d1fec96b..000000000 --- a/.github/workflows/pico-build.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# -# Copyright 2022 Paul Guyot -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Pico Build - -on: - push: - paths: - - '.github/workflows/pico-build.yaml' - - 'CMakeLists.txt' - - 'libs/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/esp32/test/main/test_erl_sources/test_crypto.erl' - - 'src/libAtomVM/**' - pull_request: - paths: - - '.github/workflows/pico-build.yaml' - - 'CMakeLists.txt' - - 'libs/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/esp32/test/main/test_erl_sources/test_crypto.erl' - - 'src/libAtomVM/**' - -permissions: - contents: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - pico: - runs-on: ubuntu-22.04 - strategy: - matrix: - board: ["pico", "pico_w"] - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: "apt update" - run: sudo apt update - - - name: "Install deps" - run: sudo apt install -y cmake gperf ninja-build gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib erlang-base erlang-dialyzer - - - name: Build - shell: bash - working-directory: ./src/platforms/rp2040/ - run: | - set -euo pipefail - mkdir build - cd build - cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }} - ninja - - - name: Install nvm and nodejs 20 - run: | - set -euo pipefail - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash - source $HOME/.nvm/nvm.sh - nvm install 20 - - - name: Build tests (without SMP) - shell: bash - working-directory: ./src/platforms/rp2040/ - run: | - set -euo pipefail - mkdir build.nosmp - cd build.nosmp - # TODO: fix all warnings and enable -DAVM_WARNINGS_ARE_ERRORS=ON - cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }} -DAVM_DISABLE_SMP=1 - cmake --build . --target=rp2040_tests - - - name: Run tests with rp2040js - shell: bash - working-directory: ./src/platforms/rp2040/tests - run: | - set -euo pipefail - source $HOME/.nvm/nvm.sh - nvm use node - npm install - npx tsx run-tests.ts ../build.nosmp/tests/rp2040_tests.uf2 ../build.nosmp/tests/test_erl_sources/rp2040_test_modules.uf2 - - - name: Build atomvmlib.uf2 - if: startsWith(github.ref, 'refs/tags/') - shell: bash - run: | - set -euo pipefail - mkdir build - cd build - cmake .. - make atomvmlib.uf2 - - - name: Rename and write sha256sum - if: startsWith(github.ref, 'refs/tags/') - shell: bash - run: | - pushd src/platforms/rp2040/build - ATOMVM_UF2=AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2 - mv src/AtomVM.uf2 "src/${ATOMVM_UF2}" - sha256sum "src/${ATOMVM_UF2}" > "src/${ATOMVM_UF2}.sha256" - popd - pushd build/libs - ATOMVMLIB_FILE=atomvmlib-${{ github.ref_name }}.uf2 - mv atomvmlib.uf2 "${ATOMVMLIB_FILE}" - sha256sum "${ATOMVMLIB_FILE}" > "${ATOMVMLIB_FILE}.sha256" - popd - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - fail_on_unmatched_files: true - files: | - src/platforms/rp2040/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2 - src/platforms/rp2040/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2.sha256 - build/libs/atomvmlib-${{ github.ref_name }}.uf2 - build/libs/atomvmlib-${{ github.ref_name }}.uf2.sha256 diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml deleted file mode 100644 index 93cd1f8d2..000000000 --- a/.github/workflows/publish-docs.yaml +++ /dev/null @@ -1,148 +0,0 @@ -# -# Copyright 2023 Winford (Uncle Grumpy) -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# -# This is a workflow for atomvm/AtomVM to Publish API documentation and other content from the `doc` directory to -# atomvm.net hosted on GitHub Pages - -name: Publish Docs - -# Controls when the workflow will run -on: - # Triggers the workflow on pull request, tag events and pushes on main - push: - tags: - - '**' - branches: - - 'main' - - 'release-**' - paths: - - '.github/workflows/publish-docs.yaml' - - 'CMakeLists.txt' - - 'doc/**' - - 'libs/**' - - 'src/libAtomVM/**' - - 'UPDATING.md' - - 'CONTRIBUTING.md' - - 'CHANGELOG.md' - - 'CODE_OF_CONDUCT.md' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }} - cancel-in-progress: false - -env: - AVM_DOCS_NAME: ${{ github.ref_name }} - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - strategy: - ## don't add more than one OS to matrix, this is only to retrieve the full os-name for keeping cache in sync - matrix: - os: [ ubuntu-24.04 ] - # The type of runner that the job will run on - runs-on: ${{ matrix.os }} - container: erlang:26.0.2 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - - name: Install Deps - run: | - apt update -y - DEBIAN_FRONTEND=noninteractive apt install -y git cmake doxygen graphviz python3-pip python3-virtualenv python3-setuptools python3-stemmer wget - - - uses: actions/cache@v4 - id: sphinx-cache - with: - path: /home/runner/python-env/sphinx - key: ${{ matrix.os }}-${{ job.container.id }}-sphinx-install - - - name: Install Sphinx - if: ${{ steps.sphinx-cache.outputs.cache-hit != 'true' }} - run: | - virtualenv /home/runner/python-env/sphinx - . /home/runner/python-env/sphinx/bin/activate - python3 -m pip install sphinx - python3 -m pip install myst-parser - python3 -m pip install sphinx-rtd-theme - python3 -m pip install rinohtype - python3 -m pip install pillow - python3 -m pip install gitpython - python3 -m pip install breathe - python3 -m pip install pygments - - - name: Install rebar3 - working-directory: /tmp - run: | - wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 - ./rebar3 local install - echo "/home/runner/.cache/rebar3/bin" >> ${GITHUB_PATH} - - - uses: actions/checkout@v4 - with: - repository: ${{ vars.GITHUB_REPOSITORY }} - fetch-depth: 0 - - - uses: actions/checkout@v4 - id: checkout-production - with: - repository: atomvm/atomvm_www - ref: Production - path: /home/runner/work/AtomVM/AtomVM/www - - - name: Track all branches - shell: bash - run: | - git config --global --add safe.directory /__w/AtomVM/AtomVM - for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}" `; do - git branch --track ${branch#remotes/origin/} $branch - done - - - name: Build Site - shell: bash - run: | - . /home/runner/python-env/sphinx/bin/activate - mkdir build - cd build - cmake .. - cd doc - make GitHub_CI_Publish_Docs - rm -frv "/__w/AtomVM/AtomVM/www/doc/${{ github.ref_name }}" - cp -av html "/__w/AtomVM/AtomVM/www/doc/${{ github.ref_name }}" - - name: Commit files - id: commit_files - if: github.repository == 'atomvm/AtomVM' - working-directory: /home/runner/work/AtomVM/AtomVM/www - run: | - git config --local user.email "atomvm-doc-bot@users.noreply.github.com" - git config --local user.name "AtomVM Doc Bot" - ls -la doc/ - git status "doc/${{ github.ref_name }}" - git add "doc/${{ github.ref_name }}" - git add . - git diff --exit-code Production || echo "Going to commit" - git diff --exit-code Production || git commit -m "Update Documentation" - git log -1 - - name: Push changes - if: github.repository == 'atomvm/AtomVM' - working-directory: /home/runner/work/AtomVM/AtomVM/www - run: | - export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" - eval `ssh-agent -t 60 -s` - echo "${{ secrets.PUBLISH_ACTION_KEY }}" | ssh-add - - mkdir -p ~/.ssh/ - echo "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl" > ~/.ssh/known_hosts - echo "github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=" >> ~/.ssh/known_hosts - echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts - git remote add push_dest "git@github.com:atomvm/atomvm_www.git" - git fetch push_dest - git diff --exit-code push_dest/Production || echo "Going to push" - git diff --exit-code push_dest/Production || git push --set-upstream push_dest Production diff --git a/.github/workflows/reuse-lint.yaml b/.github/workflows/reuse-lint.yaml deleted file mode 100644 index ed63ea86a..000000000 --- a/.github/workflows/reuse-lint.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. -# -# SPDX-License-Identifier: CC0-1.0 - -name: REUSE Compliance Check - -on: [push, pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: REUSE Compliance Check - uses: fsfe/reuse-action@v1 diff --git a/.github/workflows/run-tests-with-beam.yaml b/.github/workflows/run-tests-with-beam.yaml deleted file mode 100644 index b53fabfec..000000000 --- a/.github/workflows/run-tests-with-beam.yaml +++ /dev/null @@ -1,145 +0,0 @@ -# -# Copyright 2022 Paul Guyot -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Run tests with BEAM - -on: - push: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - pull_request: - paths-ignore: - - 'src/platforms/emscripten/**' - - 'src/platforms/esp32/**' - - 'src/platforms/rp2040/**' - - 'src/platforms/stm32/**' - - 'doc/**' - - 'LICENSES/**' - - '*.Md' - - '*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - run-tests: - runs-on: ${{ matrix.os }} - container: ${{ matrix.container }} - strategy: - fail-fast: false - matrix: - include: - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - container: erlang:21 - - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - container: erlang:22 - - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - container: erlang:23 - - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - container: erlang:24 - - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - container: erlang:25 - - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - otp: "26" - container: erlang:26 - - - os: "ubuntu-24.04" - test_erlang_opts: "-s prime_smp" - otp: "27" - container: erlang:27 - - # This is ARM64 - - os: "macos-14" - otp: "24" - path_prefix: "/opt/homebrew/opt/erlang@24/bin:" - - - os: "macos-14" - otp: "25" - path_prefix: "/opt/homebrew/opt/erlang@25/bin:" - - - os: "macos-14" - otp: "26" - path_prefix: "/opt/homebrew/opt/erlang@26/bin:" - steps: - # Setup - - name: "Checkout repo" - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: "Install deps (container)" - if: runner.os == 'Linux' - run: | - apt update -y - apt install -y cmake gperf zlib1g-dev ninja-build - - - name: "Install deps (macOS)" - if: runner.os == 'macOS' - run: brew install gperf erlang@${{ matrix.otp }} ninja mbedtls - - # Build - - name: "Build: create build dir" - run: mkdir build - - - uses: actions/cache@v4 - id: cache - with: - path: 'build/tests/**/*.beam' - key: ${{ matrix.otp }}-${{ hashFiles('**/run-tests-with-beam.yaml', 'tests/**/*.erl') }} - - - name: "Build: run cmake" - working-directory: build - run: | - export PATH="${{ matrix.path_prefix }}$PATH" - cmake -G Ninja ${{ matrix.cmake_opts }} .. - - - name: "Touch files to benefit from cache" - working-directory: build - run: | - # 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: run ninja" - working-directory: build - run: | - export PATH="${{ matrix.path_prefix }}$PATH" - ninja - - # Test - - name: "Test: test-erlang with BEAM" - timeout-minutes: 10 - working-directory: build - run: | - export PATH="${{ matrix.path_prefix }}$PATH" - ./tests/test-erlang -b ${{ matrix.test_erlang_opts }} - - # Test - - name: "Test: estdlib/ with BEAM" - timeout-minutes: 10 - working-directory: build - run: | - export PATH="${{ matrix.path_prefix }}$PATH" - erl -pa tests/libs/estdlib/ -pa tests/libs/estdlib/beams/ -pa libs/etest/src/beams -s tests -s init stop -noshell diff --git a/.github/workflows/stm32-build.yaml b/.github/workflows/stm32-build.yaml deleted file mode 100644 index b33fcccb0..000000000 --- a/.github/workflows/stm32-build.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# -# Copyright 2022 Paul Guyot -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: STM32 Build - -on: - push: - paths: - - '.github/workflows/stm32-build.yaml' - - 'CMakeLists.txt' - - 'src/platforms/stm32/**' - - 'src/libAtomVM/**' - pull_request: - paths: - - '.github/workflows/stm32-build.yaml' - - 'CMakeLists.txt' - - 'src/platforms/stm32/**' - - 'src/libAtomVM/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - stm32: - runs-on: ubuntu-24.04 - steps: - - uses: actions/cache@v4 - id: builddeps-cache - with: - path: | - /home/runner/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi - /home/runner/libopencm3 - key: ${{ runner.os }}-build-deps - - - uses: erlef/setup-beam@v1 - with: - otp-version: "27" - hexpm-mirrors: | - https://builds.hex.pm - https://repo.hex.pm - https://cdn.jsdelivr.net/hex - - - name: Install arm-embedded toolchain - if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }} - working-directory: /home/runner - run: | - set -euo pipefail - cd /home/runner - wget https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz \ - --output-document=$RUNNER_TEMP/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz - tar xJf $RUNNER_TEMP/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz - pwd && ls - - - name: Checkout and build libopencm3 - if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }} - working-directory: /home/runner - run: | - set -euo pipefail - cd /home/runner - test -d libopencm3 && rm -fr libopencm3 - export PATH=/home/runner/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin:${PATH} - git clone https://github.com/libopencm3/libopencm3.git -b v0.8.0 - cd libopencm3 - make - - - name: "apt update" - run: sudo apt update - - - name: "Install deps" - run: sudo apt install -y cmake gperf - - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Build - shell: bash - working-directory: ./src/platforms/stm32/ - run: | - set -euo pipefail - export PATH=/home/runner/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin:${PATH} - mkdir build - cd build - # -DAVM_WARNINGS_ARE_ERRORS=ON - cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DLIBOPENCM3_DIR=/home/runner/libopencm3 - make -j diff --git a/.github/workflows/wasm-build.yaml b/.github/workflows/wasm-build.yaml deleted file mode 100644 index 8de03e7f1..000000000 --- a/.github/workflows/wasm-build.yaml +++ /dev/null @@ -1,248 +0,0 @@ -# -# Copyright 2023 Paul Guyot -# -# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later -# - -name: Wasm Build - -on: - push: - paths: - - '.github/workflows/wasm-build.yaml' - - 'CMakeLists.txt' - - 'libs/**' - - 'src/platforms/emscripten/**' - - 'src/libAtomVM/**' - pull_request: - paths: - - '.github/workflows/wasm-build.yaml' - - 'CMakeLists.txt' - - 'libs/**' - - 'src/platforms/emscripten/**' - - 'src/libAtomVM/**' - -permissions: - contents: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - compile_tests: - runs-on: ubuntu-24.04 - container: erlang:27 - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Install required packages - run: apt update && apt install -y gperf zlib1g-dev cmake ninja-build - - - name: Compile AtomVM and test modules - run: | - set -e - mkdir build - cd build - cmake .. -G Ninja -DAVM_WARNINGS_ARE_ERRORS=ON - # test_eavmlib does not work with wasm due to http + ssl test - ninja AtomVM atomvmlib test_alisp hello_world run_script call_cast html5_events wasm_webserver - - - name: Upload AtomVM and test modules - uses: actions/upload-artifact@v4 - with: - name: atomvm-and-test-modules - path: | - build/**/*.avm - build/**/*.beam - build/src/AtomVM - retention-days: 1 - - - name: Compile emscripten test modules - run: | - set -e - cd src/platforms/emscripten - mkdir -p build/tests/src/ - cd build/tests/src - cmake ../../../tests/src -G Ninja - ninja emscripten_erlang_test_modules - - - name: Upload emscripten test modules - uses: actions/upload-artifact@v4 - with: - name: emscripten-test-modules - path: | - src/platforms/emscripten/build/**/*.beam - retention-days: 1 - - wasm_build_and_test_node: - needs: compile_tests - runs-on: ubuntu-latest - container: emscripten/emsdk - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: "Install deps" - run: sudo apt update -y && sudo apt install -y cmake gperf - - - name: Build - shell: bash - working-directory: ./src/platforms/emscripten/ - run: | - set -euo pipefail - mkdir build - cd build - emcmake cmake .. - emmake make -j - - - name: Download AtomVM and test modules - uses: actions/download-artifact@v4 - with: - name: atomvm-and-test-modules - path: build - - - name: Test - shell: bash - working-directory: ./src/platforms/emscripten/build - run: | - set -euxo pipefail - # Test compressed beams - node src/AtomVM.js ../../../../build/examples/erlang/hello_world.beam ../../../../build/libs/eavmlib/src/eavmlib.avm - # Run tests that pass - node src/AtomVM.js ../../../../build/tests/libs/alisp/test_alisp.avm - # test_eavmlib does not work with wasm due to http + ssl test - # node src/AtomVM.js ../../../../build/tests/libs/eavmlib/test_eavmlib.avm - - - name: "Rename and write sha256sum (node)" - if: startsWith(github.ref, 'refs/tags/') - shell: bash - working-directory: src/platforms/emscripten/build/src - run: | - ATOMVM_JS=AtomVM-node-${{ github.ref_name }}.js - mv AtomVM.js "${ATOMVM_JS}" - sha256sum "${ATOMVM_JS}" > "${ATOMVM_JS}.sha256" - ATOMVM_WORKER_JS=AtomVM.worker-node-${{ github.ref_name }}.js - mv AtomVM.worker.js "${ATOMVM_WORKER_JS}" - sha256sum "${ATOMVM_WORKER_JS}" > "${ATOMVM_WORKER_JS}.sha256" - ATOMVM_WASM=AtomVM-node-${{ github.ref_name }}.wasm - mv AtomVM.wasm "${ATOMVM_WASM}" - sha256sum "${ATOMVM_WASM}" > "${ATOMVM_WASM}.sha256" - - - name: "Release (node)" - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - fail_on_unmatched_files: true - files: | - src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.js - src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.js.sha256 - src/platforms/emscripten/build/src/AtomVM.worker-node-${{ github.ref_name }}.js - src/platforms/emscripten/build/src/AtomVM.worker-node-${{ github.ref_name }}.js.sha256 - src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.wasm - src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.wasm.sha256 - - wasm_build_web: - runs-on: ubuntu-latest - container: emscripten/emsdk - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: "Install deps" - run: sudo apt update -y && sudo apt install -y cmake gperf - - - name: Build wasm build for web - shell: bash - working-directory: ./src/platforms/emscripten/ - run: | - set -euo pipefail - mkdir build - cd build - emcmake cmake .. -DAVM_EMSCRIPTEN_ENV=web - emmake make -j - - - name: Upload wasm build for web - uses: actions/upload-artifact@v4 - with: - name: atomvm-js-web - path: | - src/platforms/emscripten/build/**/*.wasm - src/platforms/emscripten/build/**/*.js - retention-days: 1 - - wasm_test_web: - needs: [compile_tests, wasm_build_web] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Download AtomVM and test modules - uses: actions/download-artifact@v4 - with: - name: atomvm-and-test-modules - path: build - - - name: Download wasm build for web - uses: actions/download-artifact@v4 - with: - name: atomvm-js-web - path: src/platforms/emscripten/build - - - name: Download emscripten test modules - uses: actions/download-artifact@v4 - with: - name: emscripten-test-modules - path: src/platforms/emscripten/build - - - name: Test using cypress - shell: bash - run: | - set -euxo pipefail - cd build - chmod +x ./src/AtomVM - ./src/AtomVM examples/emscripten/wasm_webserver.avm & - cd ../src/platforms/emscripten/tests/ - docker run --network host -v $PWD:/mnt -w /mnt cypress/included:12.17.1 --browser chrome - killall AtomVM - - - name: "Publish screenshots of failures" - if: failure() - uses: actions/upload-artifact@v4 - with: - name: cypress-screenshots - path: | - src/platforms/emscripten/tests/cypress/screenshots/**/*.png - retention-days: 7 - - - name: "Rename and write sha256sum (web)" - if: startsWith(github.ref, 'refs/tags/') - shell: bash - working-directory: src/platforms/emscripten/build/src - run: | - ATOMVM_JS=AtomVM-web-${{ github.ref_name }}.js - mv AtomVM.js "${ATOMVM_JS}" - sha256sum "${ATOMVM_JS}" > "${ATOMVM_JS}.sha256" - ATOMVM_WORKER_JS=AtomVM.worker-web-${{ github.ref_name }}.js - mv AtomVM.worker.js "${ATOMVM_WORKER_JS}" - sha256sum "${ATOMVM_WORKER_JS}" > "${ATOMVM_WORKER_JS}.sha256" - ATOMVM_WASM=AtomVM-web-${{ github.ref_name }}.wasm - mv AtomVM.wasm "${ATOMVM_WASM}" - sha256sum "${ATOMVM_WASM}" > "${ATOMVM_WASM}.sha256" - - - name: "Release (web)" - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - draft: true - fail_on_unmatched_files: true - files: | - src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.js - src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.js.sha256 - src/platforms/emscripten/build/src/AtomVM.worker-web-${{ github.ref_name }}.js - src/platforms/emscripten/build/src/AtomVM.worker-web-${{ github.ref_name }}.js.sha256 - src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.wasm - src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.wasm.sha256