Skip to content

Commit

Permalink
Use a build script in CI and for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
fadushin committed Nov 23, 2023
1 parent 8118ddd commit 44c3fcb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ jobs:
- name: "Build Erlang Example Programs"
run: |
REBAR="/tmp/rebar3/rebar3"
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"
for i in ${EXAMPLES}; do cd ./erlang/$i; ${REBAR} fmt -c || exit 1; ${REBAR} packbeam -p -f -i || exit 1; cd ../..; done
PATH=/tmp/rebar3:$PATH ./build.sh
31 changes: 31 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
#
# This file is part of AtomVM.
#
# Copyright 2023 Fred Dushin <fred@dushin.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#

REBAR="rebar3"
cd erlang
ERLANG_EXAMPLES="$(/bin/ls | grep -v README.md)"
for i in ${ERLANG_EXAMPLES}; do
cd $i
rm -rf _build
${REBAR} atomvm packbeam -l || exit 1
${REBAR} as check fmt -c || exit 1
cd ..
done

0 comments on commit 44c3fcb

Please sign in to comment.