Skip to content

Commit

Permalink
Merge pull request #2 from csicar/ci
Browse files Browse the repository at this point in the history
CI for static binary
  • Loading branch information
csicar authored Sep 3, 2020
2 parents 2c04185 + f721cfe commit 693b157
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
22 changes: 22 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image: haskell:8.6.5

cache:
key: purty-v1
paths:
- .stack-root
- .stack-work

variables:
LC_ALL: C.UTF-8
STACK_ROOT: $CI_PROJECT_DIR/.stack-root

build:
script:
- stack build --copy-bins --local-bin-path ./artifacts --flag purepur:static
artifacts:
paths:
- ./artifacts

test:
script:
- stack build --test --no-run-tests --flag purepur:static --haddock --no-haddock-deps
29 changes: 24 additions & 5 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ extra-source-files:
- stack.yaml
- support/*

flags:
static:
manual: true
default: false

# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
Expand All @@ -22,7 +27,7 @@ description: Please see the README on Github at <https://github.com/andy
dependencies:
- base >= 4.7 && < 5
- bytestring >= 0.10.8.2 && < 0.11
- purescript -any
- purescript == 0.13.8
- base-compat >=0.6.0
- protolude >=0.1.6
- text
Expand Down Expand Up @@ -73,10 +78,24 @@ executables:
purepur:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
when:
- condition: flag(static)
then:
ghc-options:
- -main-is Main
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -static
- -O2
cc-options: -static
ld-options: -static -pthread
else:
ghc-options:
- -main-is Main
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- purepur

Expand Down

0 comments on commit 693b157

Please sign in to comment.