Skip to content

Commit

Permalink
Created GitHub action files to run style guide checker and unit tests…
Browse files Browse the repository at this point in the history
… of verifyInputProvided() (#59)
  • Loading branch information
ReedClanton authored Apr 28, 2023
1 parent 4b439f7 commit e2b1e80
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/style-guide-verifyInputProvided.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Style Guide Check of verifyInputProvided()
run-name: ${{ github.actor }} has triggered style guide check of verifyInputProvided() for the ${{ github.run_attempt }} time by initiating a ${{ github.event_name }}
on: [push, workflow_dispatch]
jobs:
style-guide-verifyInputProvided:
runs-on: ubuntu-20.04
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Install Style Guide Checking Tool...
uses: ./.github/actions/install-shfmt-via-snap
- name: Running style guide check...
run: shfmt --diff --case-indent --posix ./src/shell/functions/util/verifyInputProvided.sh

74 changes: 74 additions & 0 deletions .github/workflows/testing-unit-verifyInputProvided.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Unit Test verifyInputProvided()
run-name: ${{ github.actor }} has triggered the running of unit tests of verifyInputProvided() for the ${{ github.run_attempt }} time by initiating a ${{ github.event_name }}
on: [push, workflow_dispatch]
jobs:
unit-test-ubuntu-bash-verifyInputProvided:
runs-on: ubuntu-20.04
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Install 'Kcov' (test coverage tool) and 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-kcov-and-shellspec
- name: Running unit tests from a 'bash' shell (with code coverage) from ${{ github.workspace }}...
run: shellspec --no-fail-fast -p -s /bin/bash --kcov --kcov-options "--include-pattern=src/shell/functions/util/verifyInputProvided.sh --limits=90,100" ./spec/unit/util/verifyInputProvided_*
# TODO #53: Pipeline doesn't process --fail-low-coverage correctly.
## run: shellspec --no-fail-fast -p -s /bin/bash --kcov --kcov-options "--include-pattern=src/shell/functions/util/verifyInputProvided.sh --limits=90,100" --fail-low-coverage ./spec/unit/util/verifyInputProvided_*
unit-test-ubuntu-dash-verifyInputProvided:
runs-on: ubuntu-20.04
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Installing 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-shellspec
- name: Running unit tests from a 'dash' shell...
run: shellspec --no-fail-fast -s /bin/dash ./spec/unit/util/verifyInputProvided_*
unit-test-ubuntu-zsh-verifyInputProvided:
runs-on: ubuntu-20.04
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Installing 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-shellspec
- name: Installing 'zsh' (shell)...
uses: ./.github/actions/install-zsh-shell-via-apt
- name: Running unit tests from a 'zsh' shell...
run: shellspec --no-fail-fast -s /bin/zsh ./spec/unit/util/verifyInputProvided_*
unit-test-ubuntu-ksh-verifyInputProvided:
runs-on: ubuntu-20.04
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Installing 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-shellspec
- name: Installing 'ksh' (shell)...
uses: ./.github/actions/install-ksh-shell-via-apt-get
- name: Running unit tests from a 'ksh' shell...
run: shellspec --no-fail-fast -s /bin/ksh ./spec/unit/util/verifyInputProvided_*
unit-test-macos-bash-verifyInputProvided:
runs-on: macos-12
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Installing 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-shellspec
- name: Running unit tests from a 'bash' shell (with code coverage) from ${{ github.workspace }}...
run: $HOME/.local/bin/shellspec --no-fail-fast -s /bin/bash ./spec/unit/util/verifyInputProvided_*
unit-test-macos-dash-verifyInputProvided:
runs-on: macos-12
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Installing 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-shellspec
- name: Running unit tests from a 'dash' shell...
run: $HOME/.local/bin/shellspec --no-fail-fast -s /bin/dash ./spec/unit/util/verifyInputProvided_*
unit-test-macos-zsh-verifyInputProvided:
runs-on: macos-12
steps:
- name: Checking out ${{ github.ref_type }} ${{ github.ref_name }} from ${{ github.repository_owner }}'s ${{ github.repository }} repo on ${{ runner.os }} because ${{ github.actor }} initiated a ${{ github.event_name }}...
uses: actions/checkout@v3
- name: Installing 'shellspec' (POSIX shell script testing tool)...
uses: ./.github/actions/install-shellspec
- name: Running unit tests from a 'zsh' shell...
run: $HOME/.local/bin/shellspec --no-fail-fast -s /bin/zsh ./spec/unit/util/verifyInputProvided_*

0 comments on commit e2b1e80

Please sign in to comment.