Skip to content

Commit 44c3fcb

Browse files
committed
Use a build script in CI and for local testing
1 parent 8118ddd commit 44c3fcb

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.github/workflows/build-examples.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ jobs:
3838
3939
- name: "Build Erlang Example Programs"
4040
run: |
41-
REBAR="/tmp/rebar3/rebar3"
42-
EXAMPLES="arepl_example blinky esp_nvs deep_sleep gpio_interrupt i2c_example hello_world ledc_example read_priv spi_example system_info tcp_client tcp_server uart_example udp_client udp_server wifi"
43-
for i in ${EXAMPLES}; do cd ./erlang/$i; ${REBAR} fmt -c || exit 1; ${REBAR} packbeam -p -f -i || exit 1; cd ../..; done
41+
PATH=/tmp/rebar3:$PATH ./build.sh

build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# This file is part of AtomVM.
4+
#
5+
# Copyright 2023 Fred Dushin <[email protected]>
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
20+
#
21+
22+
REBAR="rebar3"
23+
cd erlang
24+
ERLANG_EXAMPLES="$(/bin/ls | grep -v README.md)"
25+
for i in ${ERLANG_EXAMPLES}; do
26+
cd $i
27+
rm -rf _build
28+
${REBAR} atomvm packbeam -l || exit 1
29+
${REBAR} as check fmt -c || exit 1
30+
cd ..
31+
done

0 commit comments

Comments
 (0)