Skip to content

Commit d079c45

Browse files
authored
Merge pull request #10 from esl/support_mac
Ensure support for macos
2 parents 712e22d + d844bd9 commit d079c45

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/ci.yml

+22-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@ jobs:
1919
- otp: '26.1'
2020
rebar3: '3.22.1'
2121
os: 'windows-2022'
22+
- otp: '26.1'
23+
rebar3: '3.22.1'
24+
os: 'macos-latest'
2225
runs-on: ${{matrix.os}}
2326
steps:
2427
- uses: actions/checkout@v3
25-
- uses: erlef/setup-beam@v1
28+
29+
# OS setups
30+
- name: Ubuntu/Windows – Prepare Erlang
31+
uses: erlef/setup-beam@v1
2632
with:
2733
otp-version: ${{matrix.otp}}
2834
rebar3-version: ${{matrix.rebar3}}
29-
35+
if: ${{ matrix.os != 'macos-latest' }}
3036
- name: Windows - Enable Developer Command Prompt
3137
uses: ilammy/msvc-dev-cmd@v1.12.1
3238
if: ${{ matrix.os == 'windows-2022' }}
@@ -36,7 +42,19 @@ jobs:
3642
choco install openssl
3743
echo "OPENSSL_INSTALL_DIR=""C:\Program Files\OpenSSL""" >> $env:GITHUB_ENV
3844
if: ${{ matrix.os == 'windows-2022' }}
45+
- name: MacOS – Prepare Brew
46+
run: |
47+
brew --version
48+
brew cleanup --prune=all -s
49+
brew autoremove
50+
brew untap homebrew/cask homebrew/core
51+
brew update
52+
if: ${{ matrix.os == 'macos-latest' }}
53+
- name: MacOS - Prepare Erlang
54+
run: brew install erlang rebar3
55+
if: ${{ matrix.os == 'macos-latest' }}
3956

57+
# caches
4058
- name: Restore _build
4159
uses: actions/cache@v3
4260
with:
@@ -47,6 +65,8 @@ jobs:
4765
with:
4866
path: ~/.cache/rebar3
4967
key: rebar3-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}
68+
69+
# tests
5070
- run: rebar3 as test get-deps
5171
- run: rebar3 as test compile
5272
- run: rebar3 as test ct

rebar.config

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
{port_env,
1717
[
1818
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
19-
"$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC --coverage"},
19+
"CFLAGS", "$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC -I/opt/homebrew/include -I/usr/local/include --coverage"},
2020
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
21-
"$LDLIBS -lcrypto --coverage"}
21+
"LDLIBS", "$LDLIBS -lcrypto -L/opt/homebrew/lib/ -L/usr/local/lib --coverage"}
2222
]
2323
}
2424
]}
@@ -30,9 +30,9 @@
3030
{port_env,
3131
[
3232
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
33-
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC"},
33+
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC -I/opt/homebrew/include -I/usr/local/include"},
3434
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
35-
"LDLIBS", "$LDLIBS -lcrypto"},
35+
"LDLIBS", "$LDLIBS -lcrypto -L/opt/homebrew/lib/ -L/usr/local/lib"},
3636
{"win32", "CFLAGS", "$CFLAGS /I${OPENSSL_INSTALL_DIR}/include /O2 /DNDEBUG /Wall"},
3737
{"win32", "LDLIBS", "$LDLIBS /LIBPATH:${OPENSSL_INSTALL_DIR}/lib libcrypto.lib"},
3838
{"DRV_LINK_TEMPLATE", "$DRV_LINK_TEMPLATE $LDLIBS"}

0 commit comments

Comments
 (0)