Skip to content

Commit

Permalink
Add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Jul 11, 2022
1 parent 1913e98 commit 74c18f8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
27 changes: 5 additions & 22 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,23 @@ on:
push:
branches: [ main ]

# permissions:
# contents: read
permissions:
contents: read
packages: read

jobs:
test:
name: Test suite
runs-on: ubuntu-latest
container: ghcr.io/redhat-plumbers-in-action/differential-shellcheck/test:latest
container: ghcr.io/${{ github.repository }}/test:latest

steps:
- name: Repository checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Unit tests - Bats
run: |
bash --version
bats --version
echo -e "\n\n--- Bats unit tests ---\n"
bash -c "time bats --print-output-on-failure --formatter tap test"
coverage:
name: Test coverage
runs-on: ubuntu-latest
container: ghcr.io/redhat-plumbers-in-action/differential-shellcheck/test:latest

steps:
- name: Repository checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Test coverage - Kcov
- name: Run tests using Kcov
run: |
set -x
bash --version
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

## v2.2.0

* Add option to run in debug mode - more verbose output
* Added option to run in debug mode - more verbose output
* Output optimizations - cleaner output, emojis, updated colors and spacing
* Support for job summaries
* Add support for `.bash` extensions
* Added support for `.bash` extensions
* Added unit tests and code coverage
* Added codebase linter

## v2.1.1

Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@
<h1 align="center">Differential ShellCheck</h1>
</p>

[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Differential%20Shellcheck-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/differential-shellcheck) [![Test Differential ShellCheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck/actions/workflows/shellcheck-test.yml/badge.svg)](https://github.com/redhat-plumbers-in-action/differential-shellcheck/actions/workflows/shellcheck-test.yml) [![Mergify Status][mergify-status]][mergify]
[![GitHub Marketplace][market-status]][market] [![Lint Code Base][linter-status]][linter] [![Unit Tests][test-status]][test] [![codecov](https://codecov.io/gh/redhat-plumbers-in-action/differential-shellcheck/branch/main/graph/badge.svg?token=9E9K03DRX5)](https://codecov.io/gh/redhat-plumbers-in-action/differential-shellcheck) [![Mergify Status][mergify-status]][mergify]

<!-- Status links -->

[market]: https://github.com/marketplace/actions/differential-shellcheck
[market-status]: https://img.shields.io/badge/Marketplace-Differential%20Shellcheck-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=

[linter]: https://github.com/redhat-plumbers-in-action/differential-shellcheck/actions/workflows/linter.yml
[linter-status]: https://github.com/redhat-plumbers-in-action/differential-shellcheck/actions/workflows/linter.yml/badge.svg

[test]: https://github.com/redhat-plumbers-in-action/differential-shellcheck/actions/workflows/unit-test.yml
[test-status]: https://github.com/redhat-plumbers-in-action/differential-shellcheck/actions/workflows/unit-test.yml/badge.svg

[mergify]: https://mergify.com
[mergify-status]: https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/redhat-plumbers-in-action/differential-shellcheck&style=flat

<!-- -->

This repository hosts code for running differential ShellCheck in GitHub actions. Idea of having something like differential ShellCheck was first introduced in [@fedora-sysv/initscripts](https://github.com/fedora-sysv/initscripts). Initscripts needed some way to verify incoming PR's without getting warnings and errors about already merged and for years working code. Therefore, differential ShellCheck was born.

## How does it work
Expand Down

0 comments on commit 74c18f8

Please sign in to comment.