Skip to content

Commit 50ae482

Browse files
authored
Merge pull request #182 from sue445/feature/enable_coveralls
Enabled Coveralls
2 parents 961fb31 + e8f95b5 commit 50ae482

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
- "_benchmark/**"
2020

2121
env:
22-
TEST_ARGS: -coverprofile coverage.out -covermode atomic
22+
GO_TEST_ARGS: -coverprofile coverage.out -covermode atomic
2323
TEST_GEM_DIR: ruby/testdata/example/
2424

2525
jobs:
@@ -61,19 +61,21 @@ jobs:
6161
run: bundle exec rake
6262
working-directory: ${{ env.TEST_GEM_DIR }}
6363

64+
# FIXME: workaround for gcov2lcov warning
65+
- run: rm -rf vendor/
66+
6467
- name: Convert coverage to lcov
6568
uses: jandelgado/gcov2lcov-action@v1
6669
with:
6770
infile: coverage.out
6871
outfile: coverage.lcov
6972

70-
# TODO: DO after
71-
# - name: Coveralls
72-
# uses: coverallsapp/github-action@master
73-
# with:
74-
# github-token: ${{ secrets.GITHUB_TOKEN }}
75-
# path-to-lcov: coverage.lcov
76-
# continue-on-error: true # NOTE: secrets cannot be obtained with forked repository PR
73+
- name: Coveralls
74+
uses: coverallsapp/github-action@master
75+
with:
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
path-to-lcov: coverage.lcov
78+
continue-on-error: true # NOTE: secrets cannot be obtained with forked repository PR
7779

7880
- name: Slack Notification (not success)
7981
uses: act10ns/slack@v2

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ Style/Documentation:
5858
Exclude:
5959
- "**/*_test.rb"
6060

61+
Style/FetchEnvVar:
62+
Enabled: false
63+
6164
Style/NumericPredicate:
6265
EnforcedStyle: comparison
6366

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
> Don't use in production.
77
88
[![build](https://github.com/sue445/go-gem-wrapper/actions/workflows/build.yml/badge.svg)](https://github.com/sue445/go-gem-wrapper/actions/workflows/build.yml)
9+
[![Coverage Status](https://coveralls.io/repos/github/sue445/go-gem-wrapper/badge.svg)](https://coveralls.io/github/sue445/go-gem-wrapper)
910

1011
## Requirements
1112
* Go

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ end
6969
namespace :go do
7070
desc "Run go test"
7171
task :test do
72-
sh env_vars, "go test -mod=readonly -count=1 ${TEST_ARGS} ./..."
72+
sh env_vars, "go test -mod=readonly -count=1 #{ENV["GO_TEST_ARGS"]} ./..."
7373
end
7474

7575
desc "Run go test -race"
7676
task :testrace do
77-
sh env_vars, "go test -mod=readonly -count=1 ${TEST_ARGS} -race ./..."
77+
sh env_vars, "go test -mod=readonly -count=1 #{ENV["GO_TEST_ARGS"]} -race ./..."
7878
end
7979

8080
desc "Run go fmt"

0 commit comments

Comments
 (0)