Skip to content

Commit

Permalink
build: adding ci scripts shell linting (#38)
Browse files Browse the repository at this point in the history
Unable to add it for the source code as shellcheck doesn't support Z shell
(Zsh).

* https://github.com/koalaman/shellcheck

Closes #28
  • Loading branch information
DeveloperC286 authored Mar 1, 2024
1 parent b45122b commit c0a7968
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
uses: actions/checkout@v3
- name: Check YAML formatting.
run: earthly --ci +check-yaml-formatting
shell-linting:
name: Shell Formatting
runs-on: ubuntu-latest
steps:
- name: Download Earthly v0.8.1.
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.1/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Checkout code.
uses: actions/checkout@v3
- name: Check Shell formatting.
run: earthly --ci +check-shell-linting
e2e-test:
name: End to End Test
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ fix-formatting:
BUILD +fix-yaml-formatting


check-shell-linting:
FROM ubuntu:22.04
# https://askubuntu.com/questions/462690/what-does-apt-get-fix-missing-do-and-when-is-it-useful
RUN apt-get update --fix-missing
RUN apt-get install shellcheck -y
DO +COPY_SOURCECODE
RUN ./ci/check-shell-linting.sh


check-conventional-commits-linting:
FROM +rust-base
RUN cargo install conventional_commits_linter --version 0.12.3 --locked
Expand Down
6 changes: 6 additions & 0 deletions ci/check-shell-linting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

set -o errexit
set -o xtrace

shellcheck ./ci/*

0 comments on commit c0a7968

Please sign in to comment.