-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.02 KB
/
Copy pathshellcheck.yml
File metadata and controls
35 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: ShellCheck Lint & Test Matrix
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
shellcheck:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, centos-latest, alpine-latest]
steps:
- uses: actions/checkout@v4
- name: Install ShellCheck
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
brew install shellcheck bats-core
elif [[ "${{ runner.os }}" == "Linux" ]]; then
if grep -qi alpine /etc/os-release; then
apk add --no-cache shellcheck bats
elif grep -qi centos /etc/os-release; then
yum install -y epel-release && yum install -y ShellCheck bats
else
sudo apt-get update && sudo apt-get install -y shellcheck bats
fi
fi
- name: Run ShellCheck
run: |
find . -type f -name '*.sh' -exec shellcheck --shell=bash {} +
- name: Run Bats Tests
run: |
bats tests/