Skip to content

Commit 21cca75

Browse files
committed
Add bashcov for coverage information
1 parent 33bcd26 commit 21cca75

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,26 @@ jobs:
103103
runs-on: ubuntu-latest
104104
steps:
105105
- uses: actions/checkout@v4
106+
- uses: ruby/setup-ruby@v1
107+
with:
108+
ruby-version: '3.3' # Not needed with a .ruby-version, .tool-versions or mise.toml
109+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
106110
- name: Setup Bats and bats libs
107111
id: setup-bats
108112
uses: bats-core/[email protected]
109-
- name: run unittests
113+
- name: Install Ruby dependencies
114+
run: bundle update --bundler && bundle install
115+
- name: Run unittests
110116
shell: bash
111117
env:
112118
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
113-
TERM: xterm
114-
run: bats tests/test_start_ursim.bats
119+
run: bundle exec bashcov bats tests/test_start_ursim.bats
120+
- name: Upload reports to Codecov
121+
uses: codecov/codecov-action@v5
122+
with:
123+
fail_ci_if_error: true
124+
token: ${{ secrets.CODECOV_TOKEN }}
125+
flags: start_ursim
115126

116127
check_links:
117128
runs-on: ubuntu-latest

.simplecov

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'simplecov'
2+
require 'simplecov-cobertura'
3+
4+
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Used vor bashcov coverage tool for the shell script
2+
# frozen_string_literal: true
3+
4+
source 'https://rubygems.org'
5+
6+
gem 'bashcov'
7+
gem 'simplecov'
8+
gem 'simplecov-cobertura'

0 commit comments

Comments
 (0)