Skip to content

Commit

Permalink
Merge pull request #7 from zotonic/gh-actions
Browse files Browse the repository at this point in the history
Move to GH Actions
  • Loading branch information
mworrell authored Dec 28, 2020
2 parents 2033973 + 6150e29 commit cb9e52b
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 45 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Run tests and dialyzer

name: Test

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
linux:
name: Test on OTP ${{ matrix.otp_version }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
otp_version: [19.3,20,21,22,23]
os: [ubuntu-latest]

container:
image: erlang:${{ matrix.otp_version }}

steps:
- uses: actions/checkout@v2
- name: Compile
run: make
- name: Test
run: make test
- name: XRef
run: make xref
- name: Dialyzer
run: make dialyzer
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ c_src/*.o
.eunit/
_build
c_src/eiconv_nif.d
rebar3
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
REBAR := ./rebar3
REBAR_URL := https://s3.amazonaws.com/rebar3/rebar3
ERL ?= erl

.PHONY: compile test

all: compile

compile: $(REBAR)
$(REBAR) compile

shell: $(REBAR)
$(REBAR) shell

test: $(REBAR)
$(REBAR) as test eunit

dialyzer: $(REBAR)
$(REBAR) as test dialyzer

xref: $(REBAR)
$(REBAR) as test xref

clean: $(REBAR)
$(REBAR) clean

./rebar3:
$(ERL) -noshell -s inets -s ssl \
-eval '{ok, saved_to_file} = httpc:request(get, {"$(REBAR_URL)", []}, [], [{stream, "./rebar3"}])' \
-s init stop
chmod +x ./rebar3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Erlang NIF wrapper for iconv

[![Build Status](https://travis-ci.org/zotonic/eiconv.svg?branch=master)](https://travis-ci.org/zotonic/eiconv)
![Test](https://github.com/zotonic/eiconv/workflows/Test/badge.svg)
[![Hex pm](http://img.shields.io/hexpm/v/eiconv.svg?style=flat)](https://hex.pm/packages/eiconv)

An Erlang wrapper for the character set conversion utility [iconv](https://en.wikipedia.org/wiki/Iconv).
Expand Down
46 changes: 30 additions & 16 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,34 @@
{port_specs, [{"priv/eiconv_nif.so", ["c_src/*.c"]}]}.

{profiles, [
{test,
[
{cover_enabled, true},
{cover_print_enabled, true},
{plugins, [pc]},
{artifacts, ["priv/eiconv_nif.so"]},
{provider_hooks, [
{post,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]
}
]}
]
}
{test, [
{xref_checks, [
undefined_function_calls,
locals_not_used,
deprecated_function_calls
]},

{xref_ignores, [
{eiconv, init, 0}
]},

{dialyzer, [
{warnings, [
no_return
]}
]},

{cover_enabled, true},
{cover_print_enabled, true},
{plugins, [pc]},
{artifacts, ["priv/eiconv_nif.so"]},
{provider_hooks, [
{post,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]
}
]}
]}
]}.

0 comments on commit cb9e52b

Please sign in to comment.