-
Notifications
You must be signed in to change notification settings - Fork 106
180 lines (159 loc) · 5.66 KB
/
build-and-test-other.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#
# Copyright 2022 Davide Bettio <[email protected]>
#
# 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/esp32/**'
- 'src/platforms/stm32/**'
- 'doc/**'
- 'LICENSES/**'
pull_request:
paths-ignore:
- 'src/platforms/esp32/**'
- 'src/platforms/stm32/**'
- 'doc/**'
- 'LICENSES/**'
env:
otp_version: 24
elixir_version: 1.14
jobs:
compile_tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- 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@v3
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:
arch: ["arm32v5", "arm32v7", "arm64v8"]
include:
- arch: "arm32v5"
platform: "arm/v5"
cflags: "-O2 -mthumb -mthumb-interwork -march=armv4t"
cmake_opts: "-DAVM_DISABLE_SMP=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 libssl-dev
- arch: "arm32v7"
platform: "arm/v7"
tag: "bullseye"
cflags: "-mcpu=cortex-a7 -mfloat-abi=hard -O2 -mthumb -mthumb-interwork"
- arch: "arm64v8"
platform: "arm64/v8"
tag: "bullseye"
cflags: "-O2"
# It looks like we don't really support big-endian
# - arch: "powerpc"
# distro: "jessie"
# base_url: "http://archive.debian.org/debian"
# cflags: "-std=gnu99 -Os"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- 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@v3
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 libssl-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
'