Skip to content

Merge pull request #25 from digicatapult/feature/llvm_base #12

Merge pull request #25 from digicatapult/feature/llvm_base

Merge pull request #25 from digicatapult/feature/llvm_base #12

name: lint-and-test
on: [push]
jobs:
lint:
name: Run ShellCheck
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install ShellCheck
run: sudo apt-get install shellcheck
- name: Find shell scripts with \#!/bin/sh and run ShellCheck
run: |
files=$(find . -type f ! -path '*/\.*' -exec grep -lE '^#!(/usr)?/bin/sh' {} +)
if [ -n "$files" ]; then
shellcheck -a -S warning -s sh $files
else
echo "No shell scripts with #!/bin/sh shebang found."
fi
test:
name: Run shellspec
runs-on: ubuntu-latest
steps:
- name: Install shellspec
run: |
cd ~
wget https://github.com/shellspec/shellspec/archive/0.28.1.tar.gz
tar xzvf 0.28.1.tar.gz
mkdir ~/.local/bin
ln -s ~/shellspec-0.28.1/bin/shellspec ~/.local/bin/
- name: Check out code
uses: actions/checkout@v4
- name: Run shellspec
run: shellspec