Skip to content

Commit

Permalink
Merge pull request #31 from yuce/gha
Browse files Browse the repository at this point in the history
Migrate from Travis to GitHub Actions
  • Loading branch information
yuce authored Mar 8, 2021
2 parents 9e14bb3 + 9aeab63 commit 82ac907
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 16 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: "build"
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
jobs:
ci:
name: "Run checks, tests, and docs over ${{matrix.otp_vsn}} and ${{matrix.os}}"
runs-on: "${{matrix.os}}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
container:
image: "erlang:${{matrix.otp_vsn}}"
strategy:
matrix:
otp_vsn: ["19.3", "21.3", "22.3", "23.2"] # omitting 20.3 due to TLS issue
os: ["ubuntu-latest"]
steps:
- uses: "actions/checkout@v2"
- run: "make coveralls"
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cover: test
$(REBAR) cover --verbose

coveralls: compile cover
$(REBAR) coveralls send
$(REBAR) as test coveralls send

release:
rebar3 hex publish
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![coveralls.io](https://api.travis-ci.org/yuce/pot.svg?branch=master)](https://travis-ci.org/yuce/pot)
[![Build Status](https://github.com/yuce/pot/workflows/build/badge.svg)](https://github.com/yuce/pot/actions?query=workflow:build)
[![coveralls.io](https://coveralls.io/repos/github/yuce/pot/badge.svg?branch=master)](https://coveralls.io/github/yuce/pot)
[![hex.pm](http://img.shields.io/hexpm/v/pot.svg?style=flat)](https://hex.pm/packages/pot)

Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
{cover_enabled , true}.
{cover_export_enabled , true}.
{coveralls_coverdata , "_build/test/cover/eunit.coverdata"}.
{coveralls_service_name , "travis-ci"}.
{coveralls_service_name , "github"}.
19 changes: 14 additions & 5 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
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});
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.
end.

0 comments on commit 82ac907

Please sign in to comment.