Skip to content

Commit bfc6991

Browse files
authored
Merge pull request #5060 from IntersectMBO/nm/shellcheck-ci
Move the shellcheck CI into the main workflow file
2 parents cb3d4bb + bd5d725 commit bfc6991

File tree

3 files changed

+31
-39
lines changed

3 files changed

+31
-39
lines changed

.github/workflows/haskell.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,34 @@ jobs:
379379
- name: Install fourmolu
380380
run: |
381381
FOURMOLU_VERSION="0.17.0.0"
382-
mkdir -p "$HOME/.local/bin"
383-
curl -sL "https://github.com/fourmolu/fourmolu/releases/download/v${FOURMOLU_VERSION}/fourmolu-${FOURMOLU_VERSION}-linux-x86_64" -o "$HOME/.local/bin/fourmolu"
384-
chmod a+x "$HOME/.local/bin/fourmolu"
385-
echo "$HOME/.local/bin" >> $GITHUB_PATH
382+
BINDIR=$HOME/.local/bin
383+
mkdir -p "$BINDIR"
384+
curl -sSfL "https://github.com/fourmolu/fourmolu/releases/download/v${FOURMOLU_VERSION}/fourmolu-${FOURMOLU_VERSION}-linux-x86_64" -o "$BINDIR/fourmolu"
385+
chmod a+x "$BINDIR/fourmolu"
386+
echo "$BINDIR" >> $GITHUB_PATH
386387
387388
- name: Run fourmolu
388389
run: ./scripts/fourmolize.sh
389390

391+
shellcheck:
392+
runs-on: ubuntu-latest
393+
394+
steps:
395+
- uses: actions/checkout@v4
396+
397+
- name: Install shellcheck
398+
run: |
399+
SHELLCHECK_VERSION=0.10.0
400+
BINDIR=$HOME/.local/bin
401+
mkdir -p "$BINDIR"
402+
curl -sSfL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o shellcheck.tar.xz
403+
tar -xf shellcheck.tar.xz --strip-components=1 --wildcards -C "$BINDIR" '*/shellcheck'
404+
rm shellcheck.tar.xz
405+
echo "$BINDIR" >> $GITHUB_PATH
406+
407+
- name: Run shellcheck
408+
run: scripts/shellcheck.sh
409+
390410
codegen:
391411
needs: build
392412

.github/workflows/shellcheck.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

scripts/shellcheck.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
type shellcheck
6+
7+
git ls-files scripts | xargs -rd\\n file | grep -E 'Bourne|bash' | cut -d: -f1 | xargs -rtd\\n shellcheck

0 commit comments

Comments
 (0)