Skip to content

Commit

Permalink
Use an action to run hlint, get rid of hlint test-suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Mar 28, 2022
1 parent 32af200 commit 75cbf68
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 67 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- uses: rwe/actions-hlint-setup@v1
name: Set up HLint
with:
version: "3.3.6"

- uses: actions/cache@v2
name: cache ~/.cabal/store
with:
Expand All @@ -36,11 +41,14 @@ jobs:

- name: build
run: |
cabal v2-update
cabal v2-build all --enable-tests
cabal update
cabal build all --enable-tests
- name: test golden
run: cabal v2-test test:golden --test-show-details=direct --test-option="--color=always"
run: cabal test test:golden --test-show-details=direct --test-option="--color=always"

- name: test hlint
run: cabal v2-test test:hlint --test-show-details=direct --test-option="--color=always"
- uses: rwe/actions-hlint-run@v2
name: hlint
with:
path: '["library", "exe", "test-suite-golden/src"]'
fail-on: suggestion
5 changes: 1 addition & 4 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@ jobs:
run: stack test --no-run-tests --no-terminal --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml

- name: test golden
run: stack test hpack-dhall:golden --no-terminal --test-arguments "--color=always" --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml

- name: test hlint
run: stack test hpack-dhall:hlint --no-terminal --test-arguments "--color=always" --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml
run: stack test hpack-dhall:golden --no-terminal --test-arguments "--color=always" --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml
11 changes: 0 additions & 11 deletions default-tests.dhall

This file was deleted.

32 changes: 1 addition & 31 deletions hpack-dhall.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ license: BSD3
license-file: LICENSE
build-type: Simple
tested-with:
GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.1
GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2
extra-source-files:
package.dhall
changelog.md
Expand Down Expand Up @@ -298,33 +298,3 @@ test-suite golden
, utf8-string
, yaml
default-language: Haskell2010

test-suite hlint
type: exitcode-stdio-1.0
main-is: HLint.hs
other-modules:
Hpack.Dhall
Hpack.Fields
Paths_hpack_dhall
hs-source-dirs:
library
exe
test-suite-hlint
ghc-options: -Wall -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths -rtsopts -threaded -with-rtsopts=-N
build-depends:
aeson
, aeson-pretty
, base >=4.13 && <5
, bytestring
, dhall >=1.41.1
, dhall-json >=1.7.10
, filepath
, hlint
, hpack >=0.34.7 && <0.35
, megaparsec >=9.2
, microlens
, prettyprinter
, text
, transformers
, yaml
default-language: Haskell2010
31 changes: 15 additions & 16 deletions package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ in let exe-deps = [ "optparse-applicative" ]
and functions.
''
, github = "cabalism/hpack-dhall"
, tested-with = "GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2"
, tested-with =
"GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2"
, extra-source-files =
[ "package.dhall"
, "changelog.md"
Expand Down Expand Up @@ -85,19 +86,17 @@ in let exe-deps = [ "optparse-applicative" ]
, dependencies = exe-deps
}
}
, tests =
./default-tests.dhall
{ golden =
{ main = "Golden.hs"
, source-dirs = [ "test-suite-golden/src" ]
, dependencies =
[ "Cabal"
, "Diff"
, "directory"
, "tasty"
, "tasty-golden"
, "utf8-string"
]
}
}
, tests.golden
=
{ main = "Golden.hs"
, source-dirs = [ "test-suite-golden/src" ]
, dependencies =
[ "Cabal"
, "Diff"
, "directory"
, "tasty"
, "tasty-golden"
, "utf8-string"
]
}
}

0 comments on commit 75cbf68

Please sign in to comment.