Skip to content

Commit

Permalink
Merge pull request #10 from esl/support_mac
Browse files Browse the repository at this point in the history
Ensure support for macos
  • Loading branch information
NelsonVides authored Nov 22, 2023
2 parents 712e22d + d844bd9 commit d079c45
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ jobs:
- otp: '26.1'
rebar3: '3.22.1'
os: 'windows-2022'
- otp: '26.1'
rebar3: '3.22.1'
os: 'macos-latest'
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1

# OS setups
- name: Ubuntu/Windows – Prepare Erlang
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}

if: ${{ matrix.os != 'macos-latest' }}
- name: Windows - Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.12.1
if: ${{ matrix.os == 'windows-2022' }}
Expand All @@ -36,7 +42,19 @@ jobs:
choco install openssl
echo "OPENSSL_INSTALL_DIR=""C:\Program Files\OpenSSL""" >> $env:GITHUB_ENV
if: ${{ matrix.os == 'windows-2022' }}
- name: MacOS – Prepare Brew
run: |
brew --version
brew cleanup --prune=all -s
brew autoremove
brew untap homebrew/cask homebrew/core
brew update
if: ${{ matrix.os == 'macos-latest' }}
- name: MacOS - Prepare Erlang
run: brew install erlang rebar3
if: ${{ matrix.os == 'macos-latest' }}

# caches
- name: Restore _build
uses: actions/cache@v3
with:
Expand All @@ -47,6 +65,8 @@ jobs:
with:
path: ~/.cache/rebar3
key: rebar3-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}

# tests
- run: rebar3 as test get-deps
- run: rebar3 as test compile
- run: rebar3 as test ct
Expand Down
8 changes: 4 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
{port_env,
[
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC --coverage"},
"CFLAGS", "$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC -I/opt/homebrew/include -I/usr/local/include --coverage"},
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"$LDLIBS -lcrypto --coverage"}
"LDLIBS", "$LDLIBS -lcrypto -L/opt/homebrew/lib/ -L/usr/local/lib --coverage"}
]
}
]}
Expand All @@ -30,9 +30,9 @@
{port_env,
[
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC"},
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC -I/opt/homebrew/include -I/usr/local/include"},
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"LDLIBS", "$LDLIBS -lcrypto"},
"LDLIBS", "$LDLIBS -lcrypto -L/opt/homebrew/lib/ -L/usr/local/lib"},
{"win32", "CFLAGS", "$CFLAGS /I${OPENSSL_INSTALL_DIR}/include /O2 /DNDEBUG /Wall"},
{"win32", "LDLIBS", "$LDLIBS /LIBPATH:${OPENSSL_INSTALL_DIR}/lib libcrypto.lib"},
{"DRV_LINK_TEMPLATE", "$DRV_LINK_TEMPLATE $LDLIBS"}
Expand Down

0 comments on commit d079c45

Please sign in to comment.