Skip to content

Commit

Permalink
Initial import of actions and functions for GHA
Browse files Browse the repository at this point in the history
Signed-off-by: Brian J. Murrell <brian.murrell@intel.com>
  • Loading branch information
brianjmurrell committed Dec 3, 2024
1 parent a1aa731 commit 4e9cf21
Show file tree
Hide file tree
Showing 9 changed files with 735 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Have Actions Watchers added as a reviewer to any GitHub Actions
* @daos-stack/actions-watchers
18 changes: 18 additions & 0 deletions .github/workflows/bash_unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: bash_unit Tests
on:
push:
branches:
- master
pull_request:

jobs:
bash-unit-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Unit testing with bash_unit
run: |
curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh | bash
FORCE_COLOR=true ./bash_unit tests/test_*
41 changes: 41 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Linting

# Always run on Pull Requests as then these checks can be marked as required.
on:
push:
branches:
- master
pull_request:

permissions: {}

jobs:
shell-check:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Add error parser
run: echo -n "::add-matcher::shellcheck-matcher.json"
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
format: gcc

linting-summary:
name: Linting Summary
runs-on: ubuntu-22.04
needs: [shell-check]
if: (!cancelled())
steps:
- name: Check if any job failed
run: |
if [[ -z "$(echo "${{ join(needs.*.result, '') }}" | sed -e 's/success//g')" ]]; then
echo "All jobs succeeded"
else
echo "One or more jobs did not succeed"
exit 1
fi
Loading

0 comments on commit 4e9cf21

Please sign in to comment.