Skip to content
This repository was archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
feat(dependencies): ➕ Add simplecov and coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcodes committed Jul 11, 2020
1 parent e164bfa commit 1369d37
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on:
pull_request:
branches:
- "*"

jobs:
tests:
name: Rspec Tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run Rspec
run: bin/rspec
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Tests

on:
pull_request:
branches:
- "*"
push:
branches:
- main
Expand Down Expand Up @@ -32,3 +29,5 @@ jobs:
bundle install --jobs 4 --retry 3
- name: Run Rspec
run: bin/rspec
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ spec/dest
/.bridgetown-metadata/
/.bridgetown-cache/
/.bridgetown-webpack/
spec/fixtures/.bridgetown-cache/
15 changes: 11 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ gemspec

gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "standard", "~> 0.4"
gem "solargraph", "~> 0.39"
group :development, :test do
gem "rake", "~> 13.0"
gem "standard", "~> 0.4"
gem "solargraph", "~> 0.39"
end

group :test do
gem "rspec", "~> 3.0"
gem "coveralls", "~> 0.8.23"
gem "simplecov", "~> 0.16.1"
end
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<a href="https://depfu.com/github/andrewmcodes/bridgetown-inline-svg?project_id=14094"><img src="https://badges.depfu.com/badges/54fe87f2b14868b7c6e69aa0322e3764/count.svg" alt="Depfu"></a>
<a href="https://codeclimate.com/github/andrewmcodes/bridgetown-inline-svg/maintainability"><img src="https://api.codeclimate.com/v1/badges/f9756d6568f43c7a407b/maintainability" /></a>
<a href="https://www.codacy.com/manual/andrewmcodes/bridgetown-inline-svg?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=andrewmcodes/bridgetown-inline-svg&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/caad1b16367242ff973fe2e977985364" alt="Codacy Badge"></a>
<a href='https://coveralls.io/github/andrewmcodes/bridgetown-inline-svg?branch=main'><img src='https://coveralls.io/repos/github/andrewmcodes/bridgetown-inline-svg/badge.svg?branch=main' alt='Coverage Status' /></a>
<img alt="Tests" src="https://github.com/andrewmcodes/bridgetown-inline-svg/workflows/Tests/badge.svg" />
<img alt="Linters" src="https://github.com/andrewmcodes/bridgetown-inline-svg/workflows/Linters/badge.svg" />
</p>
Expand Down

This file was deleted.

16 changes: 16 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# frozen_string_literal: true

if ENV["COVERAGE"] || ENV["GITHUB_ACTIONS"]
require "simplecov"
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::SimpleFormatter,
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
])

SimpleCov.start do
command_name "spec"
add_filter "spec"
end
end

require "bridgetown"
require File.expand_path("../lib/bridgetown-inline-svg", __dir__)

Expand Down

0 comments on commit 1369d37

Please sign in to comment.