Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI refactoring #288

Merged
merged 3 commits into from
Oct 4, 2021
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
67 changes: 46 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,64 @@
# Build gen-smtp on various OTP versions

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master

on: [push, pull_request]

jobs:

ci:
name: Checks and tests on OTP-${{matrix.otp_vsn}}, ${{matrix.os}}, ${{matrix.profile}}
runs-on: ${{matrix.os}}
name: Test on OTP ${{ matrix.otp }} / Profile ${{ matrix.profile }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
otp_vsn: [21.3, 22.3, 23.3, 24.1]
os: [ubuntu-latest]
profile: [test, ranch18, ranch20]
exclude:
- otp_vsn: 24.1 # ranch 1.7 does not work on OTP24+
profile: test

container:
image: erlang:${{matrix.otp_vsn}}
otp: ["24", "23", "22"]
rebar3: ["3.17.0"]
profile: [test, ranch_v2]
include:
- os: ubuntu-latest
otp: "21"
rebar3: "3.15.2"
profile: "test"
- os: ubuntu-latest
otp: "21"
rebar3: "3.15.2"
profile: "ranch_v2"

steps:
- uses: actions/checkout@v2
- name: xref

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3 }}

- name: Cache Hex packages
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-hex-${{ hashFiles('**/rebar.lock') }}
restore-keys: ${{ runner.os }}-hex-

- name: Cache Dialyzer PLTs
uses: actions/cache@v2
with:
path: |
~/.cache/rebar3/rebar3_*_plt
_build/dialyzer/rebar3_*_plt
key: ${{ runner.os }}-${{ matrix.otp }}-dialyzer-${{ hashFiles('**/rebar.config') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-dialyzer-

- name: Xref
run: make xref

- name: Test
run: make test REBAR_PROFILE=${{ matrix.profile }}

- name: Proper
run: make proper REBAR_PROFILE=${{ matrix.profile }}

- name: Cover
run: make cover REBAR_PROFILE=${{ matrix.profile }}
- name: Dialyze

- name: Dialyzer
run: make dialyze
36 changes: 24 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
# Build gen-smtp edoc on various OTP versions
name: Doc

name: Documentation
on:
push:
branches:
- master
- $default-branch
pull_request:
branches:
- master
- $default-branch

jobs:
ci:
name: Build edocs ${{matrix.otp_vsn}} and ${{matrix.os}}
runs-on: ${{matrix.os}}

docs:
name: Build EDoc on OTP ${{ matrix.otp }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
otp_vsn: [21.3, 22.3, 23.3, 24.0]
os: [ubuntu-latest]

container:
image: erlang:${{matrix.otp_vsn}}
otp: ["24"]
rebar3: ["3.17.0"]

steps:
- uses: actions/checkout@v2
- name: Documentation

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3 }}

- name: Cache Hex packages
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-hex-${{ hashFiles('**/rebar.lock') }}
restore-keys: ${{ runner.os }}-hex-

- name: Build EDoc
run: make docs
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
MINIMAL_COVERAGE = 75

REBAR_PROFILE = test
MINIMAL_COVERAGE = 75

compile:
@./rebar3 compile
@rebar3 compile

clean:
@./rebar3 clean -a
@rebar3 clean -a

test:
ERL_AFLAGS="-s ssl"
./rebar3 as $(REBAR_PROFILE) eunit -c
rebar3 as $(REBAR_PROFILE) eunit -c

proper:
./rebar3 as $(REBAR_PROFILE) proper -c
rebar3 as $(REBAR_PROFILE) proper -c

cover:
./rebar3 as $(REBAR_PROFILE) cover --verbose --min_coverage $(MINIMAL_COVERAGE)
rebar3 as $(REBAR_PROFILE) cover --verbose --min_coverage $(MINIMAL_COVERAGE)

dialyze:
./rebar3 as dialyzer dialyzer
rebar3 as dialyzer dialyzer

xref:
./rebar3 as test xref
rebar3 as test xref

docs:
./rebar3 edoc
rebar3 edoc

.PHONY: compile clean test dialyze
6 changes: 2 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@
]}
]}
]},
{ranch18,
[{deps, [{ranch, "1.8.0"}]}]},
{ranch20,
[{deps, [{ranch, "2.0.0"}]}]},
{ranch_v2,
[{deps, [{ranch, "2.1.0"}]}]},
{test,
[
{cover_enabled, true},
Expand Down
Binary file removed rebar3
Binary file not shown.