Skip to content

Commit

Permalink
Add coverage to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Jul 10, 2024
1 parent 4736fcd commit ec0f887
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:

jobs:
main:
name: Tests
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
services:
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,20 @@ concurrency:

jobs:
main:
name: Lint
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
Expand Down Expand Up @@ -56,7 +67,7 @@ jobs:
- run: RAILS_ENV=test bundle exec rails assets:precompile
name: Precompile assets
working-directory: ./spec/decidim_dummy_app/
- run: bundle exec rspec
- run: CI=1 bundle exec rspec
name: RSpec
- uses: codecov/codecov-action@v3
- uses: actions/upload-artifact@v3
Expand All @@ -65,3 +76,7 @@ jobs:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
- uses: coverallsapp/github-action@master
name: Coveralls
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
SimpleCov.start do
root ENV.fetch("ENGINE_ROOT", nil)

track_files "{app,lib}/**/*.rb"

add_filter "lib/generators"
add_filter "/spec"
end
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ group :development do
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 4.2"
end

group :test do
gem "coveralls_reborn", require: false
end
33 changes: 22 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ GEM
childprocess (5.0.0)
commonmarker (0.23.10)
concurrent-ruby (1.3.3)
coveralls_reborn (0.28.0)
simplecov (~> 0.22.0)
term-ansicolor (~> 1.7)
thor (~> 1.2)
tins (~> 1.32)
crack (1.0.0)
bigdecimal
rexml
Expand Down Expand Up @@ -356,17 +361,7 @@ GEM
faraday-net_http (>= 2.0, < 3.2)
faraday-net_http (3.1.0)
net-http
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
ffi (1.16.3)
file_validators (3.0.0)
activemodel (>= 3.2)
mime-types (>= 1.0)
Expand Down Expand Up @@ -488,6 +483,8 @@ GEM
tomlrb
mixlib-shellout (3.2.8)
chef-utils
mize (0.4.1)
protocol (~> 2.0)
msgpack (1.7.2)
multi_xml (0.6.0)
net-http (0.4.1)
Expand Down Expand Up @@ -576,6 +573,8 @@ GEM
actionmailer (>= 3)
net-smtp
premailer (~> 1.7, >= 1.7.9)
protocol (2.0.0)
ruby_parser (~> 3.0)
psych (4.0.6)
stringio
public_suffix (6.0.0)
Expand Down Expand Up @@ -718,6 +717,9 @@ GEM
rubyXL (3.4.27)
nokogiri (>= 1.10.8)
rubyzip (>= 1.3.0)
ruby_parser (3.21.1)
racc (~> 1.5)
sexp_processor (~> 4.16)
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -732,6 +734,7 @@ GEM
websocket (~> 1.0)
semantic_range (3.0.0)
seven_zip_ruby (1.3.0)
sexp_processor (4.17.2)
shakapacker (7.1.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
Expand Down Expand Up @@ -764,12 +767,19 @@ GEM
ssrf_filter (1.1.2)
stringio (3.1.1)
strscan (3.1.0)
sync (0.5.0)
temple (0.10.3)
term-ansicolor (1.10.2)
mize
tins (~> 1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.1)
tilt (2.3.0)
timeout (0.4.1)
tins (1.33.0)
bigdecimal
sync
tomlrb (2.0.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -836,6 +846,7 @@ PLATFORMS
DEPENDENCIES
bootsnap (~> 1.4)
byebug (~> 11.0)
coveralls_reborn
decidim (~> 0.28.0)
decidim-dev (~> 0.28.0)
decidim-ub!
Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# frozen_string_literal: true

require "decidim/dev"
require "simplecov"

if ENV["CI"]
require "coveralls"
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end

ENV["ENGINE_ROOT"] = File.dirname(__dir__)

Expand Down

0 comments on commit ec0f887

Please sign in to comment.