Skip to content

Commit

Permalink
Integrate test reporting in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Aug 19, 2024
1 parent 836f1cd commit 8b91b6f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ jobs:
run: cabal build --project-file=cabal.release.project

- name: Test
run: cabal test --project-file=cabal.release.project all
run: cabal test --project-file=cabal.release.project --test-options "--xml=dist-newstyle/report.xml" all

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'dist-newstyle/report.xml'

- name: Install
run: cabal install --project-file=cabal.release.project --installdir=distribution --install-method=copy
Expand Down
7 changes: 7 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ with-compiler: ghc-9.8
-- program-locations
-- haddock-location: haddock-9.8

allow-newer: mtl, ansi-terminal, text, tasty

test-show-details: direct

documentation: True
Expand All @@ -29,3 +31,8 @@ source-repository-package
type: git
location: https://github.com/ekmett/placeholder
tag: c958c36

source-repository-package
type: git
location: https://github.com/goodlyrottenapple/tasty-test-reporter
tag: b704130
1 change: 1 addition & 0 deletions confer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ test-suite confer-test
, tasty
, tasty-coverage
, tasty-hunit
, tasty-test-reporter
, temporary
11 changes: 7 additions & 4 deletions test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import GHC.List (List)
import System.IO
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.Runners.Reporter qualified as Reporter

import Confer.CLI.Cmd.CheckTest qualified as CheckTest
import Utils
import Utils (TestEff)
import Utils qualified

main :: IO ()
main = do
hSetBuffering stdout LineBuffering
spec <- traverse (\comp -> runTestEff comp) specs
defaultMain $
testGroup
spec <- traverse (\comp -> Utils.runTestEff comp) specs
defaultMainWithIngredients
[Reporter.ingredient]
$ testGroup
"Confer Tests"
spec

Expand Down

0 comments on commit 8b91b6f

Please sign in to comment.