From 1b3527dfeeb5b86ac027aaa8ad2b1ba5de26ff17 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 24 Aug 2026 16:47:31 -0400 Subject: [PATCH] Add test coverage reporting with coveralls.io Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/coverage.yml | 19 +++++++++++++++++++ .gitignore | 1 + CHANGELOG.md | 1 + Gemfile | 4 ++++ README.md | 1 + spec/spec_helper.rb | 4 ++++ 6 files changed, 30 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..719bda60 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,19 @@ +--- +name: Coverage + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Install Ruby (3.4) + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.4 + bundler-cache: true + - name: Build and test with RSpec + run: RACK_ENV=test bundle exec rake spec + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/.gitignore b/.gitignore index a8cc6b0b..6f685436 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ .vscode Gemfile.lock pkg +coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cc093cc..f013ab65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * [#104](https://github.com/dblock/strava-ruby-client/pull/104): Fixes `Danger Comment` workflow failing with a `contents: none` permissions error - [@dblock](https://github.com/dblock). * [#102](https://github.com/dblock/strava-ruby-client/pull/102): Changes default API base URL to `https://www.api-v3.strava.com` and adds `revoke`, deprecating `deauthorize`, per Strava's June 2026/2027 developer program changes - [@dblock](https://github.com/dblock). * [#105](https://github.com/dblock/strava-ruby-client/pull/105): Adds `total_elevation_gain`, `total_elevation_loss` and formatted helpers to `Strava::Models::Stream`, computed from altitude stream data - [@dblock](https://github.com/dblock). +* [#106](https://github.com/dblock/strava-ruby-client/pull/106): Adds test coverage reporting with [coveralls.io](https://coveralls.io) - [@dblock](https://github.com/dblock). * Your contribution here. ### 3.0.0 (2025/10/24) diff --git a/Gemfile b/Gemfile index 8786d73e..8b1cfd40 100755 --- a/Gemfile +++ b/Gemfile @@ -25,3 +25,7 @@ group :development, :test do gem 'webmock' gem 'webrick', '~> 1.9' end + +group :test do + gem 'coveralls_reborn', require: false +end diff --git a/README.md b/README.md index 33ed032c..91b727e8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Gem Version](https://badge.fury.io/rb/strava-ruby-client.svg)](https://badge.fury.io/rb/strava-ruby-client) [![Test](https://github.com/dblock/strava-ruby-client/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dblock/strava-ruby-client/actions/workflows/test.yml) +[![Coverage Status](https://coveralls.io/repos/github/dblock/strava-ruby-client/badge.svg?branch=master)](https://coveralls.io/github/dblock/strava-ruby-client?branch=master) A complete Ruby client for the [Strava API v3](https://developers.strava.com). diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 07a1a1ef..3b1f1717 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,10 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..')) require 'rubygems' + +require 'coveralls' +Coveralls.wear! + require 'rspec' require 'strava-ruby-client'