Skip to content

Commit

Permalink
Add .github
Browse files Browse the repository at this point in the history
  • Loading branch information
vkatsuba committed Feb 25, 2021
1 parent f63ff4f commit ba42b01
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @travelping/erlang-devs
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
pull_request:
branches: [ $default-branch ]
release:
types:
- created

jobs:
test:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
otp: [21.3.8.18, 22.0.7, 22.1.8, 22.2.8, 22.3.4.14, 23.0.4, 23.1.5.0, 23.2.1.0]
container:
image: erlang:${{ matrix.otp }}-alpine
steps:
- name: Prepare
run: |
apk update
apk --no-cache upgrade
apk --no-cache add gcc git libc-dev libc-utils libgcc linux-headers make bash \
musl-dev musl-utils ncurses-dev pcre2 pkgconf scanelf wget zlib
- uses: actions/checkout@v2
- name: Build
run: rebar3 compile
- name: Run tests
run: |
rebar3 do xref
rebar3 do ct
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: DEBUG=1 rebar3 as test coveralls send || /bin/true

finish:
needs: test
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -v -k https://coveralls.io/webhook \
--header "Content-Type: application/json" \
--data "{\"repo_name\":\"$GITHUB_REPOSITORY\",\"repo_token\":\"$GITHUB_TOKEN\",\"payload\":{\"build_num\":$GITHUB_RUN_NUMBER,\"status\":\"done\"}}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ _build/
.arcconfig
tetrapak/.local.cache
*~
rebar3
rebar.lock
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
gtplib
======
[![Build Status][travis badge]][travis]
[![Build Status][gh badge]][gh]
[![Coverage Status][coveralls badge]][coveralls]
[![Erlang Versions][erlang version badge]][travis]
[![Erlang Versions][erlang version badge]][gh]

Erlang library for encoding and decoding GTPv1, GTPv2 and GTP' frames.
Erlang netlink wrapper for talking the Linux kernel GTP-U module
Expand All @@ -17,8 +17,8 @@ Using rebar:
# rebar3 compile

<!-- Badges -->
[travis]: https://travis-ci.com/travelping/gtplib
[travis badge]: https://img.shields.io/travis/travelping/com/gtplib/master.svg?style=flat-square
[gh]: https://github.com/travelping/gtplib/actions/workflows/main.yml
[gh badge]: https://img.shields.io/github/workflow/status/travelping/gtplib/CI?style=flat-square
[coveralls]: https://coveralls.io/github/travelping/gtplib
[coveralls badge]: https://img.shields.io/coveralls/travelping/gtplib/master.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-R20.1%20to%21.0-blue.svg?style=flat-square
2 changes: 0 additions & 2 deletions cover.spec

This file was deleted.

4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[{deps,
[{proper, {git, "https://github.com/proper-testing/proper.git",
{branch, "master"}}}]},
{plugins, [{coveralls, "2.1.0"}]}
{plugins, [{coveralls, {git, "https://github.com/RoadRunnr/coveralls-erl.git", {branch, "feature/git-info"}}}]}
]},
{pcap,
[{deps,
Expand Down Expand Up @@ -46,5 +46,5 @@
{do_coveralls_after_ct, false}.
{do_coveralls_after_eunit, false}.
{coveralls_coverdata, "_build/test/cover/ct.coverdata"}.
{coveralls_service_name, "travis-ci"}.
{coveralls_service_name, "github"}.
{coveralls_parallel, true}.
23 changes: 16 additions & 7 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
%% -*- Erlang -*-
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId});
_ ->
CONFIG
%% -*- erlang -*-
case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
{"true", Token} when is_list(Token) ->
CONFIG1 = [{coveralls_repo_token, Token},
{coveralls_service_job_id, os:getenv("GITHUB_RUN_ID")},
{coveralls_commit_sha, os:getenv("GITHUB_SHA")},
{coveralls_service_number, os:getenv("GITHUB_RUN_NUMBER")} | CONFIG],
case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request"
andalso string:tokens(os:getenv("GITHUB_REF"), "/") of
[_, "pull", PRNO, _] ->
[{coveralls_service_pull_request, PRNO} | CONFIG1];
_ ->
CONFIG1
end;
_ ->
CONFIG
end.

0 comments on commit ba42b01

Please sign in to comment.