Skip to content

Merge pull request #695 from pguyot/w29/emscripten-enable-smp #2017

Merge pull request #695 from pguyot/w29/emscripten-enable-smp

Merge pull request #695 from pguyot/w29/emscripten-enable-smp #2017

Workflow file for this run

#
# Copyright 2017-2022 Davide Bettio <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
name: Build and Test
on:
push:
paths-ignore:
- 'src/platforms/esp32/**'
- 'src/platforms/stm32/**'
- 'doc/**'
- 'LICENSES/**'
pull_request:
paths-ignore:
- 'src/platforms/esp32/**'
- 'src/platforms/stm32/**'
- 'doc/**'
- 'LICENSES/**'
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04"]
cc: ["gcc-7", "gcc-8", "gcc-9", "gcc-10", "gcc-11", "gcc-12", "clang-10", "clang-11"]
# cc: ["gcc-7", "gcc-8", "gcc-9", "gcc-10", "gcc-11", "gcc-12", "clang-10", "clang-11", "clang-12", "clang-13", "clang-14"]
cflags: ["-O3"]
otp: ["21", "22", "23", "24", "25", "master"]
exclude:
# Ubuntu 22.04 with setup-beam only has OTP >= 24.2
- os: "ubuntu-22.04"
otp: "21"
- os: "ubuntu-22.04"
otp: "22"
- os: "ubuntu-22.04"
otp: "23"
# 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 20.04 has clang 10 and 12 to ("clang" is 10)
# Ubuntu 22.04 has clang from 12 to 14 ("clang" is 14)
# We want to test every compiler but don't need to test every OS
# and we favor later Ubuntu 22.04 + defaults
- os: "ubuntu-22.04"
cc: "gcc-7"
- os: "ubuntu-22.04"
cc: "gcc-8"
- os: "ubuntu-20.04"
cc: "gcc-10"
- os: "ubuntu-20.04"
cc: "gcc-11"
- os: "ubuntu-20.04"
cc: "gcc-12"
- os: "ubuntu-22.04"
cc: "clang-10"
- os: "ubuntu-22.04"
cc: "clang-11"
# - os: "ubuntu-20.04"
# cc: "clang-12"
# - os: "ubuntu-20.04"
# cc: "clang-13"
# - os: "ubuntu-20.04"
# cc: "clang-14"
include:
- cc: "gcc-7"
cxx: "g++-7"
compiler_pkgs: "gcc-7 g++-7"
- cc: "gcc-8"
cxx: "g++-8"
compiler_pkgs: "gcc-8 g++-8"
- cc: "gcc-9"
cxx: "g++-9"
compiler_pkgs: "gcc-9 g++-9"
- cc: "gcc-10"
cxx: "g++-10"
compiler_pkgs: "gcc-10 g++-10"
- cc: "gcc-11"
cxx: "g++-11"
compiler_pkgs: "gcc-11 g++-11"
- cc: "gcc-12"
cxx: "g++-12"
compiler_pkgs: "gcc-12 g++-12"
- cc: "clang-10"
cxx: "clang++-10"
compiler_pkgs: "clang-10"
- cc: "clang-11"
cxx: "clang++-11"
compiler_pkgs: "clang-11"
# - cc: "clang-12"
# cxx: "clang++-12"
# compiler_pkgs: "clang-12"
# - cc: "clang-13"
# cxx: "clang++-13"
# compiler_pkgs: "clang-13"
# - cc: "clang-14"
# cxx: "clang++-14"
# compiler_pkgs: "clang-14"
- otp: "21"
elixir_version: "1.7"
- otp: "22"
elixir_version: "1.8"
- otp: "23"
elixir_version: "1.11"
- otp: "24"
elixir_version: "1.14"
- otp: "25"
elixir_version: "1.14"
- otp: "master"
elixir_version: "master"
# Additional default compiler builds
- os: "ubuntu-20.04"
cc: "cc"
cxx: "c++"
otp: "25"
cflags: ""
elixir_version: "1.14"
- os: "ubuntu-22.04"
cc: "cc"
cxx: "c++"
otp: "25"
cflags: ""
elixir_version: "1.14"
# Additional latest & -Os compiler builds
- os: "ubuntu-22.04"
cc: "gcc-12"
cxx: "g++-12"
otp: "24"
cflags: "-Os"
elixir_version: "1.14"
compiler_pkgs: "gcc-12 g++-12"
# - os: "ubuntu-22.04"
# cc: "clang-14"
# cxx: "clang++-14"
# otp: "24"
# cflags: "-Os"
# elixir_version: "1.14"
# compiler_pkgs: "clang-14"
# Additional 32 bits build
- os: "ubuntu-20.04"
cc: "gcc-10"
cxx: "g++-10"
cflags: "-m32 -O3"
otp: "23"
elixir_version: "1.11"
cmake_opts_other: "-DOPENSSL_CRYPTO_LIBRARY=/usr/lib/i386-linux-gnu/libcrypto.so -DAVM_CREATE_STACKTRACES=off"
arch: "i386"
compiler_pkgs: "gcc-10 g++-10 gcc-10-multilib g++-10-multilib libc6-dev-i386
libc6-dbg:i386 zlib1g-dev:i386 libssl-dev:i386"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CFLAGS: ${{ matrix.cflags }}
CXXFLAGS: ${{ matrix.cflags }}
steps:
# Setup
- name: "Checkout repo"
uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir_version }}
- 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
# 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@v3
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
# Test
- name: "Test: test-erlang"
timeout-minutes: 10
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: 10
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: "Install and smoke test"
working-directory: build
run: |
sudo PATH=${PATH} make install
atomvm examples/erlang/hello_world.avm