-
Notifications
You must be signed in to change notification settings - Fork 106
101 lines (85 loc) · 2.69 KB
/
build-libraries.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
#
# Copyright 2017-2023 Davide Bettio <[email protected]>
#
# 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@v3
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