forked from YoEight/eventstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (98 loc) · 2.55 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.job_template: &cabal_build
stage: build
script:
- curl -G -L -o artifacts.zip --data-urlencode "job=${CI_JOB_NAME}" $ARTIFACTS_URL || true
- unzip -q artifacts.zip || true
- cabal update
- ghc-pkg init $CI_PROJECT_DIR/pkg-db || true
- cabal install --package-db $CI_PROJECT_DIR/pkg-db --prefix $CI_PROJECT_DIR/ci-cabal --only-dependencies
- cabal configure --package-db $CI_PROJECT_DIR/pkg-db --prefix $CI_PROJECT_DIR/ci-cabal
- cabal build
- cabal sdist
artifacts:
paths:
- dist/
- pkg-db/
- ci-cabal/
.job_template: &cabal_cache
paths:
- pkg-db
- ci-cabal
variables:
ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/artifacts/dev/1.0/download"
before_script:
- apt update && apt install -y unzip curl
stages:
- build
- test
- deploy
- publish
GHC 8.0:
<<: *cabal_build
image: haskell:8.0
GHC 8.2:
<<: *cabal_build
before_script:
- apt update && apt install -y unzip curl
- cabal update
- cabal install alex happy
image: haskell:8.2
GHC 8.4:
<<: *cabal_build
before_script:
- apt update && apt install -y unzip curl
- cabal update
- cabal install alex happy
image: haskell:8.4
GHC 8.6:
image: haskell:8.6
stage: build
before_script:
- apt update && apt install -y unzip curl
- cabal new-update
- cabal new-install alex happy
script:
- curl -G -L -o artifacts.zip --data-urlencode "job=${CI_JOB_NAME}" $ARTIFACTS_URL || true
- unzip -q artifacts.zip || true
- cabal --store-dir $CI_PROJECT_DIR/ci-cabal new-configure
- cabal --store-dir $CI_PROJECT_DIR/ci-cabal new-build
- cabal new-sdist
artifacts:
paths:
- dist-newstyle/
- ci-cabal/
Integration tests:
image: haskell:8.6
variables:
EVENTSTORE_HOST: "eventstore"
services:
- name: eventstore/eventstore:release-4.1.0
alias: eventstore
script:
- cabal new-update
- cabal --store-dir $CI_PROJECT_DIR/ci-cabal new-test
dependencies:
- GHC 8.6
Upload on hackage:
stage: deploy
script:
- apt update
- apt install -y curl
- cabal upload --username=$HACKAGE_LOGIN --password=$HACKAGE_PASSWORD dist-newstyle/sdist/eventstore-${CI_COMMIT_TAG}.tar.gz
image: haskell:8.6
dependencies:
- GHC 8.6
only:
- tags
Publish on hackage:
stage: publish
script:
- apt update
- apt install -y curl
- cabal upload --username=$HACKAGE_LOGIN --password=$HACKAGE_PASSWORD --publish dist-newstyle/sdist/eventstore-${CI_COMMIT_TAG}.tar.gz
image: haskell:8.6
when: manual
only:
- tags
dependencies:
- GHC 8.6