-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
3,616 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,70 @@ | ||
STACK := stack --jobs $(shell nproc) | ||
|
||
match ?= | ||
|
||
STACK_TEST_ARGS := $(if $(match),--test-arguments "--match $(match)",) | ||
|
||
.PHONY: build | ||
build: | ||
stack build | ||
$(STACK) build | ||
|
||
.PHONY: build-tests | ||
build-tests: | ||
stack build --test --no-run-tests | ||
$(STACK) build --test --no-run-tests | ||
|
||
.PHONY: ghci | ||
ghci: | ||
stack ghci | ||
$(STACK) ghci | ||
|
||
.PHONY: test | ||
test: | ||
stack test | ||
$(STACK) test $(STACK_TEST_ARGS) | ||
|
||
# Intended for use in local dev | ||
.PHONY: test-postgresql | ||
test-postgresql: reset-pgsql | ||
stack test esqueleto:postgresql | ||
$(STACK) test esqueleto:postgresql $(STACK_TEST_ARGS) | ||
|
||
.PHONY: test-mysql | ||
test-mysql: | ||
stack test esqueleto:mysql | ||
$(STACK) test esqueleto:mysql $(STACK_TEST_ARGS) | ||
|
||
.PHONY: test-ghci | ||
test-ghci: | ||
stack ghci esqueleto:test:sqlite | ||
$(STACK) ghci esqueleto:test:sqlite $(STACK_TEST_ARGS) | ||
|
||
.PHONY: test-ghcid | ||
test-ghcid: | ||
ghcid -c "stack ghci --ghci-options -fobject-code esqueleto --test" \ | ||
ghcid -c "$(STACK) ghci --ghci-options -fobject-code esqueleto --test" \ | ||
--warnings \ | ||
--restart "stack.yaml" \ | ||
--restart "esqueleto.cabal" \ | ||
--test main | ||
|
||
.PHONY: test-ghcid-build | ||
test-ghcid-build: | ||
ghcid -c "stack ghci --ghci-options -fobject-code esqueleto --test" \ | ||
ghcid -c "$(STACK) ghci --ghci-options -fobject-code esqueleto --test" \ | ||
--warnings \ | ||
--restart "stack.yaml" \ | ||
--restart "esqueleto.cabal" | ||
|
||
.PHONY: haddock doc | ||
haddock: doc | ||
doc: | ||
$(STACK) haddock | ||
|
||
.PHONY: clean | ||
clean: | ||
$(STACK) clean | ||
|
||
.PHONY: init-pgsql | ||
|
||
init-pgsql: | ||
sudo -u postgres -- createuser -s esqutest | ||
|
||
.PHONY: reset-pgsql | ||
reset-pgsql: | ||
-sudo -u postgres dropdb esqutest | ||
-sudo -u postgres dropuser esqutest | ||
echo "CREATE USER esqutest WITH PASSWORD 'esqutest';" | sudo -u postgres psql | ||
sudo -u postgres createdb -O esqutest esqutest | ||
|
||
.PHONY: build build-7.10 build-8.0 ghci test test-ghci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.