Skip to content

Commit d7ae916

Browse files
authored
Making this library Erlang bindings only. (#61)
* removed Elixir tests * removed Elixir project * removed elixir formatter and coverall settings file * added support for using precompiled binaries * updated workflows
1 parent 3c95926 commit d7ae916

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+425
-6322
lines changed

.formatter.exs

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/linux-precompile.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
precompile:
1616
runs-on: ubuntu-20.04
1717
env:
18-
MIX_ENV: prod
1918
TFLITE_BEAM_PREFER_PRECOMPILED: NO
2019

2120
strategy:
@@ -71,7 +70,6 @@ jobs:
7170
- uses: erlef/setup-beam@v1
7271
with:
7372
otp-version: "25.3"
74-
elixir-version: "1.14.3"
7573

7674
- name: Install system dependecies
7775
run: |
@@ -91,7 +89,7 @@ jobs:
9189
export TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES="${{ matrix.pair.libedgetpu_library }}"
9290
fi
9391
94-
export TFLITE_BEAM_PREFER_PRECOMPILED="NO"
92+
export TFLITE_BEAM_PREFER_PRECOMPILED="false"
9593
9694
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}"
9795
echo "TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES: ${TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES}"
@@ -102,11 +100,11 @@ jobs:
102100
echo "TARGET_OS: ${TARGET_OS}"
103101
echo "TARGET_ABI: ${TARGET_ABI}"
104102
105-
mix deps.get
106-
mix compile
103+
rebar3 deps
104+
rebar3 compile
107105
export PKG_NAME=tflite_beam-nif-${NIF_VERSION}-${{ matrix.pair.arch_name }}-${{ matrix.pair.target_os }}-${{ matrix.pair.target_abi }}-${GITHUB_REF##*/}
108106
mkdir -p "${PKG_NAME}"
109-
cp -a _build/${MIX_ENV}/lib/tflite_beam/priv "${PKG_NAME}"
107+
cp -a ./priv "${PKG_NAME}"
110108
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}"
111109
rm -rf "${PKG_NAME}"
112110
ls -lah "${PKG_NAME}.tar.gz"

.github/workflows/linux-x86_64.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,19 @@ concurrency:
2929
cancel-in-progress: true
3030

3131
jobs:
32-
mix_test:
32+
rebar3_compile:
3333
runs-on: ubuntu-20.04
3434
env:
35-
MIX_ENV: test
3635
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
TFLITE_BEAM_CORAL_SUPPORT: "YES"
38-
TFLITE_BEAM_PREFER_PRECOMPILED: NO
36+
TFLITE_BEAM_CORAL_SUPPORT: "true"
37+
TFLITE_BEAM_PREFER_PRECOMPILED: "false"
3938

4039
steps:
4140
- uses: actions/checkout@v3
4241

4342
- uses: erlef/setup-beam@v1
4443
with:
4544
otp-version: "25.3"
46-
elixir-version: "1.14.3"
4745

4846
- name: Install system dependecies
4947
run: |
@@ -52,5 +50,5 @@ jobs:
5250
5351
- name: Compile and Test
5452
run: |
55-
mix deps.get
56-
mix coveralls.github
53+
rebar3 deps
54+
rebar3 compile

.github/workflows/macos-precompile.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ jobs:
1515
precompile:
1616
runs-on: macos-11
1717
env:
18-
MIX_ENV: prod
19-
TFLITE_BEAM_PREFER_PRECOMPILED: "NO"
18+
TFLITE_BEAM_PREFER_PRECOMPILED: "false"
2019

2120
strategy:
2221
fail-fast: false
@@ -37,9 +36,13 @@ jobs:
3736
brew install elixir erlang autoconf automake
3837
mix local.hex --force
3938
mix local.rebar --force
39+
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
40+
./rebar3 local install
4041
4142
- name: Create precompiled library
4243
run: |
44+
export PATH="~/.cache/rebar3/bin:$PATH"
45+
4346
export NIF_VERSION="$(erl -noshell -s init stop -eval "io:format('~ts', [erlang:system_info(nif_version)]).")"
4447
if [ "${{ matrix.pair.arch }}" = "aarch64" ]; then
4548
export TARGET_ARCH="${{ matrix.pair.arch }}"
@@ -55,11 +58,11 @@ jobs:
5558
echo "TARGET_OS: ${TARGET_OS}"
5659
echo "TARGET_ABI: ${TARGET_ABI}"
5760
58-
mix deps.get
59-
mix compile
61+
rebar3 deps
62+
rebar3 compile
6063
export PKG_NAME=tflite_beam-nif-${NIF_VERSION}-${{ matrix.pair.arch }}-apple-darwin-${GITHUB_REF##*/}
6164
mkdir -p "${PKG_NAME}"
62-
cp -a _build/${MIX_ENV}/lib/tflite_beam/priv "${PKG_NAME}"
65+
cp -a ./priv "${PKG_NAME}"
6366
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}"
6467
rm -rf "${PKG_NAME}"
6568
mkdir -p artifacts

.github/workflows/macos-x86_64.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,27 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
jobs:
30-
mix_test:
30+
rebar3_compile:
3131
runs-on: macos-11
3232
env:
33-
MIX_ENV: test
34-
TFLITE_BEAM_CORAL_SUPPORT: "YES"
35-
TFLITE_BEAM_PREFER_PRECOMPILED: NO
33+
TFLITE_BEAM_CORAL_SUPPORT: "true"
34+
TFLITE_BEAM_PREFER_PRECOMPILED: "false"
3635

3736
steps:
38-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3938

4039
- name: Install Erlang and Elixir
4140
run: |
4241
brew install erlang
4342
brew install elixir
4443
mix local.hex --force
4544
mix local.rebar --force
45+
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
46+
./rebar3 local install
4647
brew install autoconf automake
4748
48-
- name: Compile and Test
49+
- name: Compile
4950
run: |
50-
mix deps.get
51-
mix test
51+
export PATH="~/.cache/rebar3/bin:$PATH"
52+
rebar3 deps
53+
rebar3 compile

.github/workflows/nerves-build.yml

Lines changed: 0 additions & 140 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ tflite_beam-*.tar
3232
# The directory rebar3 will write compiled artifacts to.
3333
priv/
3434
cmake_tflite_beam/
35+
tflite_beam_precompiled.beam

.gitlab-ci.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)