Skip to content

Commit

Permalink
ci: Run shfmt and shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Dec 3, 2023
1 parent e6ab3cd commit 50e4898
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ concurrency:
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- uses: cachix/cachix-action@v12
with:
name: devenv
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
- run: devenv ci

test:
strategy:
matrix:
Expand All @@ -25,6 +36,7 @@ jobs:
- plugin: stack
fail-fast: true
runs-on: ${{ matrix.os }}
needs: [check]
steps:
- uses: asdf-vm/actions/plugin-test@v3
with:
Expand Down
7 changes: 4 additions & 3 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{ pkgs, ... }:

{
packages = [ pkgs.shfmt ];

languages.javascript.enable = true;

pre-commit.hooks.shellcheck.enable = true;
pre-commit.hooks = {
shellcheck.enable = true;
shfmt.enable = true;
};
}
2 changes: 1 addition & 1 deletion lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ install_version() {

ensure_ghcup

if [[ "$tool" == "ghc" ]] || { [[ "$tool" == "hls" ]] && [[ $(ver "$version") -ge $(ver "1.7") ]]; }; then
if [[ $tool == "ghc" ]] || { [[ $tool == "hls" ]] && [[ $(ver "$version") -ge $(ver "1.7") ]]; }; then
"$(ghcup_bin_dir)/ghcup" install "$tool" "$version" -i "$path"
else
"$(ghcup_bin_dir)/ghcup" install "$tool" "$version" -i "${path}/bin"
Expand Down

0 comments on commit 50e4898

Please sign in to comment.