Skip to content

Commit 549d015

Browse files
authored
Merge pull request #5804 from IntersectMBO/smelc/add-shellcheck-and-actionlint-to-ci
CI: add shellcheck and actionlint
2 parents 4a18841 + 637c9dd commit 549d015

6 files changed

Lines changed: 146 additions & 1 deletion

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.github/workflows/haskell.yml
2+
.github/workflows/release-ghcr.yaml
3+
.github/workflows/release-upload.yaml
4+
.github/workflows/stylish-haskell.yml

.github/workflows/actionlint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Actionlint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
actionlint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
# We want to install Nix to provision shellcheck, so that actionlint doesn't install
13+
# its own shellcheck. This will also make sure that this pipeline runs using
14+
# the same shellcheck as the ones in Nix shells of developers.
15+
- name: Install Nix with good defaults
16+
uses: input-output-hk/install-nix-action@v20
17+
with:
18+
extra_nix_config: |
19+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
20+
substituters = https://cache.nixos.org/ https://cache.iog.io/
21+
nix_path: nixpkgs=channel:nixos-unstable
22+
- uses: cachix/install-nix-action@v18
23+
with:
24+
nix_path: nixpkgs=channel:nixos-unstable
25+
# Make the Nix environment available to next steps
26+
- uses: rrbutani/use-nix-shell-action@v1
27+
28+
- name: actionlint
29+
run: |
30+
for file in $(git ls-files ".github/workflows/*.y*ml")
31+
do
32+
if grep -q "$file" ".github/workflows/actionlint-exceptions.txt"
33+
then
34+
echo "⚠️ $file is ignored from actionlint's verifications. Please consider fixing it."
35+
else
36+
echo "actionlint $file"
37+
actionlint "$file"
38+
fi
39+
done

.github/workflows/github-page.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
tar -czf haddocks.tgz -C haddocks .
5151
5252
- name: Upload haddocks artifact
53-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
5454
if: ${{ always() }}
5555
continue-on-error: true
5656
with:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.github/bin/haddocks.sh
2+
scripts/ci/check-cabal-files.sh
3+
bench/process/process.sh
4+
bench/script/probe.sh
5+
cardano-submit-api/test/run.sh
6+
cardano-tracer/demo/multi/run.sh
7+
cardano-tracer/demo/ssh/run.sh
8+
ci/check-dependencies-merged-to-master.sh
9+
ci/check-hydra.sh
10+
configuration/cardano/update-config-files.sh
11+
nix/regenerate.sh
12+
nix/workbench/analyse/analyse.sh
13+
nix/workbench/backend/backend.sh
14+
nix/workbench/backend/nomad.sh
15+
nix/workbench/backend/nomad/cloud.sh
16+
nix/workbench/backend/nomad/exec.sh
17+
nix/workbench/backend/nomad/podman.sh
18+
nix/workbench/backend/supervisor.sh
19+
nix/workbench/chaindb.sh
20+
nix/workbench/env.sh
21+
nix/workbench/lib-cabal.sh
22+
nix/workbench/lib.sh
23+
nix/workbench/manifest.sh
24+
nix/workbench/nomad.sh
25+
nix/workbench/profile/pparams/apiPparamsImport.sh
26+
nix/workbench/profile/pparams/diffLatest.sh
27+
nix/workbench/profile/pparams/diffLatestWithOverlay.sh
28+
nix/workbench/profile/pparams/pparamsLastWithOverlay.sh
29+
nix/workbench/profile/profile.sh
30+
nix/workbench/publish.sh
31+
nix/workbench/run.sh
32+
nix/workbench/scenario.sh
33+
nix/workbench/topology/topology.sh
34+
scripts/babbage/example-babbage-script-usage.sh
35+
scripts/babbage/mkfiles.sh
36+
scripts/babbage/script-context-equivalance-test.sh
37+
scripts/babbage/script-mint-context-equivalance-test.sh
38+
scripts/babbage/staking-example/claim-script-staking-rewards.sh
39+
scripts/babbage/staking-example/register-and-delegate-script-staking-address.sh
40+
scripts/bin-path.sh
41+
scripts/byron-to-alonzo/burn.sh
42+
scripts/byron-to-alonzo/mint.sh
43+
scripts/byron-to-alonzo/mkfiles.sh
44+
scripts/byron-to-alonzo/update-3.sh
45+
scripts/byron-to-alonzo/update-4.sh
46+
scripts/byron-to-alonzo/update-5.sh
47+
scripts/ci/check-cabal-files.sh
48+
scripts/gen-merge-summary.sh
49+
scripts/lite/example-build-cmd.sh
50+
scripts/lite/shelley-testnet-2.sh
51+
scripts/lite/shelley-testnet.sh
52+
scripts/lite/shutdown-ipc-example.sh
53+
scripts/lite/split-txouts.sh
54+
scripts/plutus/always-fails.sh
55+
scripts/plutus/example-txin-locking-plutus-script.sh
56+
scripts/plutus/script-context-equivalance-test.sh
57+
scripts/plutus/script-context-equivalence-test-minting.sh
58+
scripts/plutus/simple-minting-policy.sh
59+
scripts/plutus/staking-example/claim-script-staking-rewards.sh
60+
scripts/test-stake-cred-script/create-collateral.sh

.github/workflows/shellcheck.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Shellcheck
2+
# This pipeline runs shellcheck on all files with extension .sh,
3+
# except the ones listed in .github/workflows/shellcheck-exceptions.txt.
4+
#
5+
# This pipeline uses Nix, so that the shellcheck version used is the same
6+
# ones as used by developers in Nix shells. This ensures the CI's behavior
7+
# is consistent with the one of developers.
8+
9+
on:
10+
pull_request:
11+
12+
jobs:
13+
shellcheck:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Install Nix with good defaults
18+
uses: input-output-hk/install-nix-action@v20
19+
with:
20+
extra_nix_config: |
21+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
22+
substituters = https://cache.nixos.org/ https://cache.iog.io/
23+
nix_path: nixpkgs=channel:nixos-unstable
24+
- uses: cachix/install-nix-action@v18
25+
with:
26+
nix_path: nixpkgs=channel:nixos-unstable
27+
# Make the Nix environment available to next steps
28+
- uses: rrbutani/use-nix-shell-action@v1
29+
- name: shellcheck
30+
run: |
31+
for file in $(git ls-files "*.sh")
32+
do
33+
if grep -q "$file" ".github/workflows/shellcheck-exceptions.txt"
34+
then
35+
echo "⚠️ $file is ignored from shellcheck's verifications. Please consider fixing it."
36+
else
37+
echo "shellcheck $file"
38+
shellcheck "$file"
39+
fi
40+
done

nix/haskell.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ let
4848
ghcid
4949
haskell-language-server
5050
cabal
51+
actionlint
52+
shellcheck
5153
];
5254

5355
withHoogle = true;

0 commit comments

Comments
 (0)