Skip to content

Commit

Permalink
Check shell scripts are formatted with shfmt; Fix shellcheck lint wor…
Browse files Browse the repository at this point in the history
…kflow

Signed-off-by: Ben Krieger <[email protected]>
  • Loading branch information
ben-krieger authored and nckrss committed Nov 19, 2024
1 parent 53e252a commit f1986f6
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@ jobs:
runs-on: ubuntu-latest
container:
image: golangci/golangci-lint:latest-alpine
env:
GOFLAGS: -buildvcs=false
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Lint Go source files
run: |
apk add --no-cache gcc g++ openssl-dev
export GOFLAGS=-buildvcs=false
go work init
go work use -r .
golangci-lint run ./...
golangci-lint run ./examples/...
golangci-lint run ./fsim/...
golangci-lint run ./sqlite/...
golangci-lint run ./tpm/...
- name: Lint base library
run: golangci-lint run ./...
- name: Lint FSIM
run: golangci-lint run ./fsim/...
- name: Lint sqlite
run: golangci-lint run ./sqlite/...
- name: Lint TPM
run: golangci-lint run ./tpm/...
- name: Lint examples
run: golangci-lint run ./examples/...

shellcheck:
name: Lint Shell Scripts
Expand All @@ -35,7 +41,18 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4
- name: Run ShellCheck
run: find . \( -name "*.sh" -o -name "*.bash" \) -exec shellcheck '{}' +
run: find . -name '*.sh' -o -name '*.bash' | xargs shellcheck

shfmt:
name: Check Shell Script Formatting
runs-on: ubuntu-latest
container:
image: mvdan/shfmt:v3-alpine
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Check shfmt diff
run: find . -name '*.sh' -o -name '*.bash' | FORCE_COLOR=1 xargs shfmt -d

markdownlint:
name: Lint Documentation Markdown
Expand Down

0 comments on commit f1986f6

Please sign in to comment.