Skip to content

Commit 57f13c2

Browse files
Add run-tests script
1 parent 7a0134c commit 57f13c2

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ sudo dnf install -y ghc cabal-install && cabal update
3636
Run the tests:
3737

3838
```ShellSession
39-
$ cabal build all && cabal test all
39+
$ ./bin/run-tests
4040
```
4141

4242
Some tests requires a local matrix server, run integration service:

bin/run-tests

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh -e
2+
3+
log() {
4+
/bin/echo -e "\n\x1b[1;33m[+] $*\x1b[0m";
5+
}
6+
7+
log "Building"
8+
cabal build -O0 --ghc-option=-Werror
9+
10+
log "Testing"
11+
cabal test -O0 --test-show-details=direct
12+
cabal check
13+
14+
log "Doctests"
15+
cabal repl --with-compiler=doctest --repl-options='-w -Wdefault -XOverloadedStrings'
16+
17+
log "Formatting"
18+
fourmolu -i src/ test/
19+
cabal-gild --io matrix-client.cabal
20+
nixfmt flake.nix
21+
22+
log "Linting"
23+
hlint src/ test/
24+
25+
log "Check for diff"
26+
if [ ! -z "$(git status --porcelain)" ]; then
27+
git status
28+
exit 1
29+
fi

0 commit comments

Comments
 (0)