Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

version: 2
updates:
- package-ecosystem: "github-actions"
Expand Down
63 changes: 30 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,60 @@
---

name: CI

on:
pull_request:
push:
branches: [ "main" ]
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
yamllint:
runs-on: ubuntu-latest
strategy:
matrix:
otp_version: ['27.1', '26.2', '25.3']

steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
version-type: 'strict'
- name: Checkout Code
uses: actions/checkout@v4
- name: Run YAML Lint
uses: actionshub/yamllint@main

- uses: actions/cache@v4
markdownlint-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run markdownlint-cli
uses: nosborn/github-action-markdown-cli@v3.4.0
with:
path: |
~/.cache/rebar3
_build
key: ${{ runner.os }}-erlang-${{ matrix.otp_version }}-${{ hashFiles('**/*rebar.lock') }}

- run: make build
files: .
config_file: ".markdownlint.yaml"

test:
name: Test
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}}
strategy:
matrix:
otp_version: ['27.1', '26.2', '25.3']

needs:
- build

otp: ['27', '26', '25']
rebar3: ['3.24']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
version-type: 'strict'

otp-version: ${{ matrix.otp }}
rebar3-version: ${{matrix.rebar3}}
- uses: actions/cache@v4
with:
path: |
~/.cache/rebar3
_build
key: ${{ runner.os }}-erlang-${{ matrix.otp_version }}-${{ hashFiles('**/*rebar.lock') }}

key: ${{ runner.os }}-erlang-${{ matrix.otp }}-rebar3-${{ matrix.rebar3 }}-hash-${{hashFiles('rebar.lock')}}
- run: make build
- run: make test
# - name: Coveralls
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to disable it due to errors.

# uses: coverallsapp/github-action@v2
# with:
# file: _build/test/covertool/dns_erlang.covertool.xml
13 changes: 13 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
default: true

# no-hard-tabs
MD010:
code_blocks: false

# no-multiple-blanks
MD012:
maximum: 2

# line-length
MD013: false
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

9 changes: 9 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: default
rules:
line-length:
max: 256
level: warning
truthy:
ignore: |
/.github/workflows/*.yml
57 changes: 28 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
REBAR:=$(shell which rebar3 || echo ./rebar3)
REBAR_URL:="https://s3.amazonaws.com/rebar3/rebar3"

all: deps compile

$(REBAR):
wget $(REBAR_URL) && chmod +x rebar3

build: compile

compile: $(REBAR)
@$(REBAR) compile

deps: $(REBAR)
@$(REBAR) get-deps

doc: $(REBAR)
@$(REBAR) doc skip_deps=true

clean: $(REBAR)
@$(REBAR) clean
@rm -fr doc/*

fresh:
rm -fr _build/*

test: $(REBAR) all
@$(REBAR) dialyzer
@$(REBAR) eunit skip_deps=true
all: build

.PHONY: build
build:
rebar3 compile

.PHONY: doc
doc:
rebar3 edoc

.PHONY: clean
clean:
rebar3 clean
@rm -rf doc

.PHONY: fresh
fresh: clean
rm -rf _build

.PHONY: test
test: all
rebar3 fmt --check
rebar3 eunit
rebar3 do cover, covertool generate

.PHONY: format
format: build
rebar3 fmt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![CI](https://github.com/dnsimple/base32_erlang/actions/workflows/ci.yml/badge.svg)

```
```erlang
1> X = <<"foobar">>.
<<"foobar">>
2> X0 = base32:encode(X).
Expand Down
37 changes: 28 additions & 9 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
% -*- mode: Erlang; -*-
{cover_enabled, true}.
{cover_print_enabled, true}.
{erl_opts, [warnings_as_errors]}.
{erl_opts, [
warnings_as_errors
]}.

{project_plugins, [
erlfmt
{rebar3_hex, "~> 7.0"},
{rebar3_ex_doc, "~> 0.2"},
{erlfmt, "~> 1.6"},
{covertool, "~> 2.0.7"}
]}.

{profiles, [
{test, [
{erl_opts, [nowarn_export_all, nowarn_missing_spec, nowarn_missing_doc]},
{eunit_opts, [verbose]},
{covertool, [{coverdata_files, ["eunit.coverdata", "ct.coverdata"]}]},
{cover_opts, [verbose, {min_coverage, 60}]},
{cover_enabled, true},
{cover_export_enabled, true}
]}
]}.

{eunit_opts, [verbose]}.
{hex, [{doc, #{provider => ex_doc}}]}.

{ex_doc, [
{source_url, <<"https://github.com/dnsimple/base32_erlang">>},
{main, <<"readme">>},
{extras, [
{'README.md', #{title => <<"Overview">>}},
{'LICENSE', #{title => <<"License">>}}
]}
]}.

{erlfmt, [
write,
{print_width, 140}
]}.

{dialyzer, [
{warnings, [no_unknown]}
]}.