Skip to content

Commit

Permalink
Merge pull request #7 from esl/update_ci
Browse files Browse the repository at this point in the history
Update ci
  • Loading branch information
NelsonVides authored Nov 21, 2023
2 parents a8c90f2 + d916ff1 commit e950e1b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 65 deletions.
70 changes: 49 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,56 @@ on:

jobs:
test:
name: OTP ${{matrix.otp}}
name: OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}} / OS ${{matrix.os}}
strategy:
matrix:
otp: ['24.0', '23.3', '22.3', '21.3']
runs-on: 'ubuntu-20.04'
env:
OTPVER: ${{ matrix.otp }}
os: ['ubuntu-22.04']
otp: ['26.1', '25.3', '24.3']
rebar3: ['3.22.1']
include:
- otp: '26.1'
rebar3: '3.22.1'
os: 'windows-2022'
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: ErlGang/setup-erlang@v1.0.0
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- run: make rebar3
- run: make deps
- run: make test
- run: make dialyzer
if: ${{ matrix.otp == '24.0' }}
- run: make codecov
if: ${{ matrix.otp == '24.0' }}
- run: make gcov
if: ${{ matrix.otp == '24.0' }}
- run: pip install --user codecov
if: ${{ matrix.otp == '24.0' }}
- run: /home/runner/.local/bin/codecov
if: ${{ matrix.otp == '24.0' }}
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}

- name: Windows - Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.12.1
if: ${{ matrix.os == 'windows-2022' }}
- name: Windows - Install openssl
shell: pwsh
run: |
choco install openssl
echo "OPENSSL_INSTALL_DIR=""C:\Program Files\OpenSSL""" >> $env:GITHUB_ENV
if: ${{ matrix.os == 'windows-2022' }}

- name: Restore _build
uses: actions/cache@v3
with:
path: _build
key: _build-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}
- name: Restore rebar3's cache
uses: actions/cache@v3
with:
path: ~/.cache/rebar3
key: rebar3-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}
- run: rebar3 as test get-deps
- run: rebar3 as test compile
- run: rebar3 as test ct
- run: rebar3 dialyzer
if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
- name: Run coverage
if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
run: |
rebar3 as test codecov analyze
gcov -o c_src fast_pbkdf2
- name: Upload coverage
if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
run: |
pip install --user codecov
/home/runner/.local/bin/codecov
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ priv/
erl_crash.dump
*.ez
*.tar

codecov.json
36 changes: 0 additions & 36 deletions Makefile

This file was deleted.

18 changes: 11 additions & 7 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
{proper, "1.4.0"}
]},
{plugins, [
{rebar3_codecov, "0.3.0"}]},
{rebar3_codecov, "0.6.0"}]},
{port_env,
[
{"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC -I/opt/homebrew/include -I/usr/local/include --coverage"},
{"LDLIBS", "$LDLIBS -lcrypto -L/opt/homebrew/lib/ -L/usr/local/lib --coverage"}
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC --coverage"},
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"$LDLIBS -lcrypto --coverage"}
]
}
]}
Expand All @@ -27,10 +29,12 @@

{port_env,
[
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)", "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 -L/opt/homebrew/lib/ -L/usr/local/lib"},
{"win32", "CFLAGS", "$CFLAGS /O2 /DNDEBUG /Wall"},
{"win32", "LDLIBS", "$LDLIBS libcrypto.lib"},
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC"},
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"LDLIBS", "$LDLIBS -lcrypto"},
{"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 e950e1b

Please sign in to comment.