Skip to content

Commit

Permalink
ci: add uncovered lines report to test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoomTen committed Jun 19, 2024
1 parent 458ebf4 commit 86b615a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/ci/bashcov.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ruby:latest

# https://github.com/infertux/bashcov/issues/43#issuecomment-1423015292

RUN gem install bashcov simplecov-lcov
RUN useradd -m bashcov

RUN apt-get update && \
apt-get install -y libpng-dev pkg-config build-essential bison git curl

COPY . /rgbenv
WORKDIR /rgbenv
RUN chown -R bashcov:bashcov /rgbenv

USER bashcov

RUN make bats
RUN echo "require 'simplecov-lcov'" > .simplecov && \
echo "SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter" >> .simplecov

CMD ["bash", ".github/ci/bashcov.sh"]


5 changes: 5 additions & 0 deletions .github/ci/bashcov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

bashcov -- /rgbenv/bats/bin/bats tests

cat coverage/lcov/rgbenv.lcov | grep ",0"
6 changes: 4 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
with:
path: rgbenv

- name: Run tests
run: make test
- name: Run tests and print lines without coverage
run: |
docker build -t rgbenv-test -f .github/ci/bashcov.dockerfile .
docker run -t --rm rgbenv-test
working-directory: rgbenv/

0 comments on commit 86b615a

Please sign in to comment.