Skip to content

Commit

Permalink
Merge pull request #740 from IntersectMBO/smelc/ci-actionlint
Browse files Browse the repository at this point in the history
CI: run actionlint
  • Loading branch information
smelc authored Apr 25, 2024
2 parents 5056246 + 7c74ffd commit 7b247b3
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/actionlint-exceptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/check-stylish-haskell.yml
44 changes: 44 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Actionlint

on:
pull_request:

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# We want to install Nix to provision shellcheck, so that actionlint doesn't install
# its own shellcheck. This will also make sure that this pipeline runs using
# the same shellcheck as the ones in Nix shells of developers.
- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.iog.io/ https://cache.nixos.org/
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
# Make the Nix environment available to next steps
- uses: rrbutani/use-nix-shell-action@v1

- name: Install actionlint
run: |
# Puts the "actionlint" binary in the working folder
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: Run Actionlint
run: |
for file in $(git ls-files ".github/workflows/*.y*ml")
do
if grep -q "$file" ".github/workflows/actionlint-exceptions.txt"
then
echo "⚠️ $file is ignored from actionlint's verifications. Please consider fixing it."
else
echo "./actionlint $file"
./actionlint "$file"
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/check-cabal-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Workaround runner image issue
if: runner.os == 'Linux'
# https://github.com/actions/runner-images/issues/7061
run: sudo chown -R $USER /usr/local/.ghcup
run: sudo chown -R "$USER" /usr/local/.ghcup

- name: Install Haskell
uses: input-output-hk/setup-haskell@v1
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ jobs:
- name: Build Haddock documentation 🔧
run: ./.github/bin/haddocks.sh ./haddocks true

- name: View HTML files
run: |
find "dist-newstyle/build" -name '*.html' | xargs grep html
- name: Upload documentation
uses: actions/upload-artifact@v2
if: ${{ always() }}
Expand Down
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
stylish-haskell = "0.14.5.0";
};
# and from nixpkgs or other inputs
shell.nativeBuildInputs = with nixpkgs; [ gh jq yq-go ];
shell.nativeBuildInputs = with nixpkgs; [ gh jq yq-go shellcheck ];
# disable Hoogle until someone request it
shell.withHoogle = false;
# Skip cross compilers for the shell
Expand All @@ -93,9 +93,9 @@
({pkgs, ...}: {
packages.cardano-cli.configureFlags = [ "--ghc-option=-Werror" ] ++ gitRevFlag;
packages.cardano-cli.components.tests.cardano-cli-test.build-tools =
with pkgs.buildPackages; [ jq coreutils shellcheck ];
with pkgs.buildPackages; [ jq coreutils ];
packages.cardano-cli.components.tests.cardano-cli-golden.build-tools =
with pkgs.buildPackages; [ jq coreutils shellcheck ];
with pkgs.buildPackages; [ jq coreutils ];
})
({
pkgs,
Expand Down

0 comments on commit 7b247b3

Please sign in to comment.