Skip to content

Commit 693b157

Browse files
authored
Merge pull request #2 from csicar/ci
CI for static binary
2 parents 2c04185 + f721cfe commit 693b157

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

.gitlab-ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
image: haskell:8.6.5
2+
3+
cache:
4+
key: purty-v1
5+
paths:
6+
- .stack-root
7+
- .stack-work
8+
9+
variables:
10+
LC_ALL: C.UTF-8
11+
STACK_ROOT: $CI_PROJECT_DIR/.stack-root
12+
13+
build:
14+
script:
15+
- stack build --copy-bins --local-bin-path ./artifacts --flag purepur:static
16+
artifacts:
17+
paths:
18+
- ./artifacts
19+
20+
test:
21+
script:
22+
- stack build --test --no-run-tests --flag purepur:static --haddock --no-haddock-deps

package.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ extra-source-files:
1010
- stack.yaml
1111
- support/*
1212

13+
flags:
14+
static:
15+
manual: true
16+
default: false
17+
1318
# Metadata used when publishing your package
1419
# synopsis: Short description of your package
1520
# category: Web
@@ -22,7 +27,7 @@ description: Please see the README on Github at <https://github.com/andy
2227
dependencies:
2328
- base >= 4.7 && < 5
2429
- bytestring >= 0.10.8.2 && < 0.11
25-
- purescript -any
30+
- purescript == 0.13.8
2631
- base-compat >=0.6.0
2732
- protolude >=0.1.6
2833
- text
@@ -73,10 +78,24 @@ executables:
7378
purepur:
7479
main: Main.hs
7580
source-dirs: app
76-
ghc-options:
77-
- -threaded
78-
- -rtsopts
79-
- -with-rtsopts=-N
81+
when:
82+
- condition: flag(static)
83+
then:
84+
ghc-options:
85+
- -main-is Main
86+
- -threaded
87+
- -rtsopts
88+
- -with-rtsopts=-N
89+
- -static
90+
- -O2
91+
cc-options: -static
92+
ld-options: -static -pthread
93+
else:
94+
ghc-options:
95+
- -main-is Main
96+
- -threaded
97+
- -rtsopts
98+
- -with-rtsopts=-N
8099
dependencies:
81100
- purepur
82101

0 commit comments

Comments
 (0)