forked from build-trust/ockam
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.68 KB
/
shell.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This workflow checks shell scripts
name: Shell
permissions:
contents: read
on:
merge_group:
pull_request:
paths:
- ".github/workflows/shell.yml"
- "**.sh"
- "**.bash"
push:
paths:
- ".github/workflows/shell.yml"
- "**.sh"
- "**.bash"
branches:
- develop
workflow_dispatch:
inputs:
commit_sha:
description: Git commit sha, on which, to run this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
# shellcheck gives warnings and suggestions for bash/sh shell scripts.
# https://github.com/koalaman/shellcheck
lint_shellcheck:
name: Shell - lint_shellcheck
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
ref: ${{ github.event.inputs.commit_sha }}
- run: shellcheck -S error $(find . -not -path "./demos/*" -iname "*.sh" -o -name "*.bash")
# shfmt checks format of shell programs
# https://github.com/mvdan/sh#shfmt
lint_shfmt:
name: Shell - lint_shfmt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
ref: ${{ github.event.inputs.commit_sha }}
- name: Install Nix
uses: ./.github/actions/nix_installer_and_cache
with:
cache-unique-id: shell
id: nix-installer
- name: Run Shfmt Check
run: nix run ./tools/nix#shfmt-all
- name: Nix Upload Store
uses: ./.github/actions/nix_upload_store
if: ${{ steps.nix-installer.outputs.cache-hit != 'true' }}