Examine behaviour of hlint and fourmolu without Stack

This commit is contained in:
Jack Hodgkinson 2022-02-14 13:43:35 +00:00
parent 1b55c3ea00
commit 4ab1fb0376
2 changed files with 26 additions and 28 deletions

View file

@ -18,17 +18,17 @@ jobs:
check-formatting: check-formatting:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2.4.0
- uses: actions/cache@v2.1.4 # - uses: actions/cache@v2.1.4
name: Add Stack files to cache # name: Add Stack files to cache
with: # with:
path: ~/.stack # path: ~/.stack
key: ${{ runner.os }}-stack-formatting # key: ${{ runner.os }}-stack-formatting
restore-keys: ${{ runner.os }}-stack- # restore-keys: ${{ runner.os }}-stack-
- run: stack install fourmolu # - run: stack install fourmolu
name: Install fourmolu # name: Install fourmolu
- run: ./.github/format.sh - run: ./.github/format.sh
name: Run fourmolu name: Run fourmolu
@ -36,32 +36,34 @@ jobs:
run-linter: run-linter:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2.4.0
- uses: actions/cache@v2.1.4 # - uses: actions/cache@v2.1.4
name: Add Stack files to cache # name: Add Stack files to cache
with: # with:
path: ~/.stack # path: ~/.stack
key: ${{ runner.os }}-stack-lint # key: ${{ runner.os }}-stack-lint
restore-keys: ${{ runner.os }}-stack- # restore-keys: ${{ runner.os }}-stack-
- run: stack install hlint # - run: stack install hlint
name: Install hlint # name: Install hlint
- run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') # - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
- run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
name: Run hlint name: Run hlint
check-build: check-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v13 - uses: cachix/install-nix-action@v16
name: Set up Nix and IOHK caches name: Set up Nix and IOHK caches
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: | extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v10 - uses: cachix/cachix-action@v10
with: with:
name: mlabs name: mlabs
@ -76,4 +78,5 @@ jobs:
dist-newstyle dist-newstyle
key: ${{ runner.os }}-cabal key: ${{ runner.os }}-cabal
- name: Build the project - name: Build the project
run: nix build .#check.x86_64-linux --extra-experimental-features nix-command --extra-experimental-features flakes run: nix build
run: nix flake check

View file

@ -5,14 +5,9 @@ import Prelude
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
import Test.Tasty (defaultMain, testGroup) import Test.Tasty (defaultMain, testGroup)
import Test.Tasty.HUnit (assertBool, testCase)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
main :: IO () main :: IO ()
main = main =
defaultMain $ defaultMain $ testGroup "Suites" []
testGroup
"Suites"
[ testCase "will fail" $ assertBool "false" False
]