Skip to content

Commit df168eb

Browse files
committed
Run fourmolu instead of stylish-haskell in Update workflow
1 parent e1e074d commit df168eb

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

.github/workflows/update.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,36 @@ jobs:
3737
commit_message: 'Materialize Nix expressions'
3838
file_pattern: 'nix/ *.cabal'
3939

40-
stylish-haskell:
41-
name: 'stylish-haskell'
40+
fourmolu:
41+
name: 'Style'
4242
runs-on: ubuntu-latest
4343
steps:
44-
- name: Install stylish-haskell
45-
run: |
46-
cd $(mktemp -d)
47-
wget https://github.com/jaspervdj/stylish-haskell/releases/download/v0.11.0.0/stylish-haskell-v0.11.0.0-linux-x86_64.tar.gz
48-
tar xaf stylish-haskell-v0.11.0.0-linux-x86_64.tar.gz
49-
sudo mv stylish-haskell-v0.11.0.0-linux-x86_64/stylish-haskell /usr/local/bin/
50-
stylish-haskell --version
51-
52-
- uses: actions/[email protected]
44+
- name: Check out code
45+
uses: actions/[email protected]
5346
with:
5447
submodules: recursive
5548

56-
- name: Format with stylish-haskell
57-
run: stylish-haskell -i -r kore
49+
- name: Install Nix
50+
uses: cachix/install-nix-action@v12
51+
with:
52+
extra_nix_config: |
53+
substituters = http://cache.nixos.org https://hydra.iohk.io
54+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
55+
56+
- name: Install Cachix
57+
uses: cachix/cachix-action@v8
58+
with:
59+
name: kore
60+
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
61+
skipPush: true
62+
63+
- name: Format
64+
run: |
65+
./nix/fourmolu.sh
5866
5967
- name: Commit changes
6068
uses: stefanzweifel/[email protected]
6169
with:
62-
commit_message: 'Format with stylish-haskell'
70+
commit_message: 'Format with fourmolu'
71+
file_pattern: '*.hs'
72+

nix/fourmolu.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell ../shell.nix -i bash
3+
4+
fd '.*\.hs$' | xargs fourmolu -o -XTypeApplications -o -XPatternSynonyms -o -XBangPatterns -i

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let
1010
pkgs = import sources."nixpkgs" {};
1111

1212
inherit (pkgs) cabal-install ghcid stack;
13-
inherit (pkgs) gnumake yq z3;
13+
inherit (pkgs) fd gnumake yq z3;
1414

1515
# Change the compiler when updating our own resolver.
1616
compiler-nix-name = "ghc8104";

0 commit comments

Comments
 (0)